JARs installed to the local Maven repository via Gradle are not accepted by Maven

I’m deploying snapshot JARs built with Gradle to my local Maven repository via ./gradlew publishToMavenLocal. This creates a time-stamped JAR and POM in my repo as expected.

But when building a Maven project depending on this snaphot, Maven will still retrieve the JAR from the configured remote repositories (as e.g. given in settings.xml). I’m assuming that Maven finds out that this JAR doesn’t originate from any of the known remote repositories and thus needs to be fetched again. Is there any way to make Maven work with the snapshot installed by Gradle instead?



I think you are running into a known problem with the new, incubating ‘maven-publish’ plugin, namely that it mistakenly installs unique snapshots into the local Maven repository. In that case, the workaround is to use the old ‘maven’ plugin.

I see, thanks for the fast reply. Do you know when this issue might be fixed? I’m indeed using the new plug-in, also for customization of the resulting POM. I’ll try using the old plug-in for the time being.

I don’t have any information on that.

Ok; I’ve also found the issue for this (GRADLE-2762) in between.