0
votes

all

There are two questions actually.

  1. I'm now using Sonatype Nexus 2.11.3-01 as my private repository server. However, logged in with admin, I found that the Artifact Upload tab is missing in default Snapshots repository. I'm not sure why as this tab is in Releases or 3rd party. Is this a defect or am I missing something when doing setting in Nexus? This will cause 401 error when trying to deploy the jar file to Snapshots repository -- Return code is: 401, ReasonPhrase: Unauthorized. -> (I checked my setting for credentials and they are all correct.)

  2. I have a customized jar file and I would like to put it into Snapshots repository. But when using Maven to upload the snapshot jar into Nexus, it will add a timestamp in the file name. Based on my search in Maven 3 it drop the support to remove the timestamp in snapshots. So is it possible to retrieve the latest jar in Nexus from POM file?

Thanks!

1
Can you show your full settings.xml file (of course without the passwords ;-)) - khmarbaise

1 Answers

0
votes

The Upload tab in a SNAPSHOT repository does usually make no sense cause a SNAPSHOT repository is intended for SNAPSHOT's and not for 3rd Party artifacts which will usually uploaded once and used over a longer time. The Snapshot repository will be used by Maven/Gradle etc. to upload SNAPSHOTs during the development. If you have a customized JAR which i assume will not change that often should be put it into 3rdParty repository instead of SNAPSHOT. A SNAPSHOT repository is a storage for a shorter time period which should be cleaned up at least after creating a release of your artifact (project in Maven).

If you put something like Name-1.0-SNAPSHOT into Nexus SNAPSHOT repository the artifacts are internally named like Name-1.0-20150701-203434-1.jar this is made by Nexus and not by Maven.

If you like to get the latest SNAPSHOT state from the nexus repository you have to use mvn -U ... on maven command line (If you like to change the default behaviour you can change that by configuring in your settings.xml).