I’m using Gralde 1.6 and Nexus as repository manager.
In my build I have dependencies to artifacts in a common Nexus repository. Build failure shows that there is a dependency problem. It cannot find an artifact with a certain name (without time stamp). After investigating the Nexus repo, I found out that during deploying to Nexus, a time stamp was added to the common artifacts.
So my question is, how can I do an uploadArchives without the time stamp in the jars?
Kind regards, Jeroen.
A timestamp will be appended to the version (only) when uploading a snapshot (that’s how Maven snapshots work). The way to suppress this is not to publish a snapshot, i.e. not to publish a version ending in ‘-SNAPSHOT’.
Thank you Peter,
I think my problem has something to do with the ext.isSnapshot. I still don’t understand it completely, but when I set ext.isSnapshot=true, then time stamps are added to the artifacts. But the most important is that the Maven metadata.xml on Jenkins has snapshot information as well. When ext.isSnapshot=false, time stamps are still added because of the -SNAPSHOT qualifier in the artifacts, but the metadata is not correctly uploaded to Nexus. It is missing the references to the time-stamped snapshot versions.
Can you confirm this behavior? And if yes, can you point to the documentation of this feature? I couldn’t find it anywhere.
‘ext.isSnapshot’ is not a Gradle feature. It’s either implemented by your build, or by a third-party Gradle plugin that you are using. Probably the former.
Okay, that still leaves me at square 1.
Is there a way to print the used maven repositories?
I see that it first tries to resolve the dependencies in the public repositories, but they are in nexus snapshots. Furthermore, a build --info reveals that the maven-metadata.xml of the public repositories are reported missing. But for the snapshot repository (where it should find the dep.) it is not even trying to read the maven-metadata.xml And in this maven-metadata.xml the correct reference to the snapshot version can be found.
I’ve put a log and maven-metadata.xml on https://gist.github.com/yeronimuz/6492539
I will create a new topic, because the title does not cover the payload anymore
How to download the SNAPSHOT artifacts? when I am trying to download the same artifacts, it fails saying that -SNAPSHOT is not found, which is logical because the jars are uploaded as _timestamp.