I have a module dependency for jsch because the parent is a Maven multi-module build, and I prefer them to be grouped under the parent. However, I found when I used a dynamic version, I no longer get the dependencies:
plugins {
id 'java'
}
repositories {
jcenter()
}
ext {
jschVersion = '0.0.+'
}
dependencies {
compile module("com.jcraft:jsch.agentproxy:${jschVersion}") {
['jsch', 'sshagent', 'usocket-jna', 'usocket-nc'].each {
dependency "com.jcraft:jsch.agentproxy.${it}:${jschVersion}"
}
}
}
Results in:
compile - Compile classpath for source set 'main'.
\--- com.jcraft:jsch.agentproxy:0.0.+ -> 0.0.9
Whereas 0.0.9 results in:
compile - Compile classpath for source set 'main'.
\--- com.jcraft:jsch.agentproxy:0.0.9
+--- com.jcraft:jsch.agentproxy.usocket-nc:0.0.9
| \--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.jcraft:jsch.agentproxy.jsch:0.0.9
| +--- com.jcraft:jsch:0.1.49
| \--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.jcraft:jsch.agentproxy.usocket-jna:0.0.9
| +--- com.jcraft:jsch.agentproxy.core:0.0.9
| +--- net.java.dev.jna:jna:4.1.0
| \--- net.java.dev.jna:jna-platform:4.1.0
| \--- net.java.dev.jna:jna:4.1.0
\--- com.jcraft:jsch.agentproxy.sshagent:0.0.9
\--- com.jcraft:jsch.agentproxy.core:0.0.9