Maven metadata with classifiers fails to resolve for snapshots

(Ole Christian Langfjæran) #1

Gradle Version: 3.1 and 2.x versions
OS: Any

This happens if your project has a dependency to a SNAPSHOT who has classifiers. For some reason the maven-metadata.xml for those kind of dependencies can end up looking like this:

<metadata modelVersion="1.1.0">

The keen eye can notice here that timestamp and buildnumber is not the same in as in . The maven-metadata.xml is created by a maven project and pushed to Nexus. I do not know maven-metadata.xml ends up like this, but I does so every time. Maven it self is able to overcome this and just downloads whatever is inside

Gradle on the other hand fails with this:

> Could not find com:mylib:1.0-SNAPSHOT.
  Searched in the following locations:

See also how it tries to download timestamp-buildnumber.
I’ve created a reproducable project which generates this error:

A more correct way to resolve the classifier-dependency would be to use instead of resolving the url from timestamp and buildnumber.