Upgrading to Gradle 2.6 publishing to Nexus

I am currently upgrading from Gradle 2.2.1 to Gradle 2.6, and have run into an issue with uploadArchives. We have a very specific versioning system that requires the version to be passed down the pipeline. With this upgrade to Gradle 2.6 we are now getting ${version_we_want}+TIMESTAMP, and this is causing problems when trying to pull that version later on in the pipeline. One thing I did notice and found odd was that the maven-metadata.xml is stored at ${version_we_want}/maven-metadata.xml. However the jars, zips, and other archives are stored at ${version_we_want}+TIMESTAMP/${version_we_want}-TIMESTAMP.

I have tried setting the uniqueVersion to false, but it does not work.

This makes me think that the project’s version property actually has the timestamp in it and this is unrelated to publishing. Can you confirm that <version> in the POM also contains the timestamp?

I should have mentioned I am uploading to the snapshots repository. The version in the POM does not include the timestamp. I also print out the project.version property and it does not include the timestamp.

This change in behavior started happening as a result of the upgrade to 2.6? There were not changes to the Nexus repository configuration?

I am testing in our CI pipeline and the only thing that has changed is the gradle version being used (2.2.1 to 2.6).

I also assume you are using HTTP/HTTPS?

Yes, we are uploading over HTTP/HTTPS

Are you attempting to use --parallel or using any other type of concurrency in your build scripts?

No I am not using any type of concurrency.

This might be related to this change in Gradle 2.5. Can you try with Gradle 2.4 to see if the problem still exists?

@Marco_Corona how are you getting the version which is being passed down the pipeline? Are you deriving it from something (artifacts) produced locally by the publishing mechanism.

No we aren’t. We produce the version through jenkins and pass it into the gradle scripts.

@mark_vieira It definitely seems to be related to this, because our build does work just fine with Gradle 2.4

Is there any idea on this?

I haven’t been able to reproduce the issue as I don’t have a local Nexus server (seems to work fine with Artifactory though). Have you tried publishing to a local (file system) repo? If so, do you have the same problem?