There appears to be a bug related to Maven classifiers. The problems occurs when one version of a pom declares an artifact with a classifier and a later version does not.
The problem is illustrated by a simple build with two dependencies:
apply plugin: 'java'
apply plugin: 'application'
repositories {
mavenCentral()
}
mainClassName = 'com.example.Foo'
dependencies {
compile 'org.mariadb.jdbc:mariadb-java-client:1.1.8'
compile 'net.java.dev.jna:jna:4.1.0'
}
net.java.dev.jna:jna:3.3.0
has an artifact with a platform
classifier in 3.3.0, but does not have this artifact in 4.1.0.
mariadb-java-client
has a transitive dependency on net.java.dev.jna:jna:3.3.0
. Due to the direct dependency on 4.1.0, this dependency is dropped in favour of the 4.1.0 dependency:
compile - Compile classpath for source set 'main'.
+--- org.mariadb.jdbc:mariadb-java-client:1.1.8
| +--- net.java.dev.jna:jna:3.3.0 -> 4.1.0
| \--- commons-dbcp:commons-dbcp:1.4
| \--- commons-pool:commons-pool:1.5.4
\--- net.java.dev.jna:jna:4.1.0
When the application plugin resolves the runtime
configuration as part of the startScripts
task, it fails as it’s looking for jna-4.1.0-platform.jar
which does not exist:
Could not resolve all dependencies for configuration ':runtime'.
> Could not find jna-platform.jar (net.java.dev.jna:jna:4.1.0).
Searched in the following locations:
https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.1.0/jna-4.1.0-platform.jar
It looks like the classifier-related metadata from the 3.3.0 pom is being applied to the 4.1.0 artifacts.
Edit: I neglected to mention that the above was tested with Gradle 2.3