6

apparently my Nexus is rejecting every deploy I throw at him if the artifact has not -SNAPSHOT in the version.

Data:

  • name of the failing artifact: entando-core-engine-experiment-bundles_with_bootstrap.jar where experiment-bundles_with_bootstrap is the version as in the version element of the pom.xml
  • hosted repository policy on my Nexus: Snapshot, allow redeploy and so on (classic conf for snapshots)
  • deployer: Jenkins 1.481
  • same Jenkins job, but entando-core-engine-SNAPSHOT.jar ---> SUCCESS

I need this naming convention because I'm building one of the several experiments we run internally, as opposite to the canonical develop branch which produces a proper entando-core-engine-SNAPSHOT.jar

Any advice? I'm totally lost.

William Ghelfi
  • 427
  • 7
  • 17
  • What are you using to build these artifacts. The naming convention seems to omit the version string. In addition redeployments of artifacts into a release are not allowed by default (but can be enabled even if that is a bad idea. – Manfred Moser Nov 28 '12 at 01:28
  • as I stated, the policy for the hosted repository is Snapshots (not release). I'm editing the question with further details about the naming convetions. – William Ghelfi Nov 28 '12 at 09:17
  • Can you try a manual artifact upload and see if that works? And also.. what tool are you using for the deployment? Maven? Something else? – Manfred Moser Nov 28 '12 at 21:06
  • 1
    I just wanted to thank you for posting this question beyond up-voting it because it saved me in the 11th hour. I was getting errors about SNAPSHOT not allowing my version but NOTHING that pointed me to the fact I needed SNAPSHOT at the end. I changed my snapshots to release and now I can give them the version I want without the obvious appendage of SNAPSHOT at the end. Really if I have a version like 1.34.2cod9rf (last git commit hash) does it need to really be stated that it's a SNAPSHOT? :-D – Justin May 11 '17 at 12:23

2 Answers2

2

The thing is that usually your Nexus is configured not to allow a redeployment of a release. A release from Maven point of view is an artifact where it's version it NOT -SNAPSHOT. In contradiction a SNAPSHOT is intended to be deployed several times into nexus.
This sounds like you don't using the release plugin of Maven nor the Release PLugin of Jenkins.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • 1
    This seems a bit of a hint... I'll try asap to circumvent the fact that Nexus defaults to mandatory -SNAPSHOT for Snapshot repositories: I'll change the repository policy to Release and I'll try to also set "Allow Redeploys --> true" – William Ghelfi Nov 28 '12 at 09:23
  • I wouldn't do so. Cause the idea of releases is they will be deployed exactly once. – khmarbaise Nov 28 '12 at 11:33
  • Yes, I agree. But given the updated question with more details, how can I then have the naming convention I need for this experiment + my artifacts in my company's Nexus? – William Ghelfi Nov 28 '12 at 11:41
  • 2
    Marked this as the answer because in the end I settled down with a Nexus repo with Release policy and Allow Redeploys. It's a workaround. I just whish Maven and Nexus would accept a custom string instead of just SNAPSHOT for builds that are - *in fact* - development builds, hence snapshots. – William Ghelfi Nov 30 '12 at 09:43
0

Nexus is a repository manager that uses different repository formats, with the main format being the Maven repository format. Changing the names of artifacts on the server is not possible since it violates the format. They have to be located in the directory structure established by groupId, artifactId and version and use the artifactId-version-classifier.packaging for the file names.

If you need a different file name on the server you have to look at a different repository format (bad idea). If you need the filename on the client just download from the correct name and rename..

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
  • I'm sorry, but I read this thrice and still can't understand how it fits in the scenario depicted by my question... – William Ghelfi Nov 29 '12 at 09:39
  • I am not sure what you are asking. I am saying you can NOT force a naming convention on the server. The maven repository format dictates the file name. – Manfred Moser Nov 29 '12 at 21:20