Re: Need Help for Nexus 3.0 snapshot file upload

4,749 views
Skip to first unread message
Message has been deleted

Rich Seddon

unread,
Nov 14, 2016, 9:50:08 AM11/14/16
to Nexus Users
Nexus won't generate a timestamped snapshot, that is the responsibility of the tool doing the deploy.

Try using the maven deploy:deploy-file goal as described here, that will do what you want:



Rich

On Mon, Nov 14, 2016 at 8:38 AM, priytam shukla <priytam....@gmail.com> wrote:
Hi Friends,

I am pretty new in the Nexus 3.0 and wanted to upload snapshot jar file into nexus default repository for learning and having dummy jar file "maven-artifact-9.1.1-SNAPSHOT.jar" which I have renamed  (not sure do I need to ).

I am using curl command to upload it as below :

curl -v -u username:password --upload-file "path of file\maven-artifact-9.1.1-SNAPSHOT.jar" http://hostname:8081/repository/maven-snapshots/org/apache/maven/plugins/maven-artifact/9.1.1-SNAPSHOT/maven-artifact-9.1.1-SNAPSHOT.jar

Path : "org/apache/maven/plugins/maven-artifact/9.1.1-SNAPSHOT" I have taken as read somewhere (not sure if it is correct)

after running it gets uploaded into repository maven-snapshots however it is not adding time stamp as it should which I have read in documentation.

I do not have any other file or something.Do I need to create POM file and upload it into same Repository before uploading jar file so going forward each time I upload the  the file with SNAPSHOT name it should append the time stamp.

Please help me creating POM file for above jar file.

Thank you !

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/6d56af5a-8fcc-4c15-8929-e144417083c5%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Message has been deleted

priytam shukla

unread,
Nov 15, 2016, 3:59:01 AM11/15/16
to Nexus Users
Hi Rich,

Thank you so much.I am trying to use the link you provided however path : "http://localhost:8081/nexus/service/local/artifact/maven/content" I am not able to find it on my nexus server :my nexus version is 3.1.0-04"

when I am trying to upload any jar file with SNAPSHOT in both of the places in URL when using old curl command : 9.1.1-SNAPSHOT/maven-artifact-9.1.1-SNAPSHOT.jar it is getting uploaded however 

while  doing as  "/3.3.9-SNAPSHOT/maven-artifact-3.3.9-20161115.jar " it is giving 400 :Invalid path for maven 2 repository

As per link suggested by you : commands are as below :

mvn deploy:deploy-file -DgroupId=com.somecompany -DartifactId=project -Dversion=1.0.0 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=nexus -Durl=http://localhost:8081/nexus/content/repositories/releases -Dfile=target/project-1.0.0.jar
curl -v -F r=releases -F hasPom=true -F e=jar -F file=@pom.xml -F file=@project-1.0.jar -u admin:admin123 http://localhost:8081/nexus/service/local/artifact/maven/content
Here I am not able to find the path "http://localhost:8081/nexus/service/local/artifact/maven/content" 
not able to find the path : /nexus/content/repositories/releases
Can you please suggest about above paths, do they present on nexus or we need to configure it and is there any other rest API which allows us to upload the snapshot with timestamp.
Or is it mandatory to upload SnapShot with timestamp :
This is the last question from my side for this topic and apologies for any inconvenience  
Thanks in advance

On Tue, Nov 15, 2016 at 11:57 AM, priytam shukla <priytam....@gmail.com> wrote:
Hi Rich,

Thank you so much.I am trying to use the link you provided however path : "http://localhost:8081/nexus/service/local/artifact/maven/content" I am not able to find it on my nexus server :my nexus version is 3.1.0-04"

when I am trying to upload any jar file with SNAPSHOT in both of the places in URL when using old curl command : 9.1.1-SNAPSHOT/maven-artifact-9.1.1-SNAPSHOT.jar it is getting uploaded however 

while  doing as  "/3.3.9-SNAPSHOT/maven-artifact-3.3.9-20161115.jar " it is giving 400 :Invalid path for maven 2 repository

As per link suggested by you : commands are as below :

mvn deploy:deploy-file -DgroupId=com.somecompany -DartifactId=project -Dversion=1.0.0 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=nexus -Durl=http://localhost:8081/nexus/content/repositories/releases -Dfile=target/project-1.0.0.jar
curl -v -F r=releases -F hasPom=true -F e=jar -F file=@pom.xml -F file=@project-1.0.jar -u admin:admin123 http://localhost:8081/nexus/service/local/artifact/maven/content
Here I am not able to find the path "http://localhost:8081/nexus/service/local/artifact/maven/content" 
not able to find the path : /nexus/content/repositories/releases
Can you please suggest about above paths, do they present on nexus or we need to configure it and is there any other rest API which allows us to upload the snapshot with timestamp.
Thanks in advance

On Monday, 14 November 2016 20:20:08 UTC+5:30, Rich Seddon wrote:
Nexus won't generate a timestamped snapshot, that is the responsibility of the tool doing the deploy.

Try using the maven deploy:deploy-file goal as described here, that will do what you want:



Rich
On Mon, Nov 14, 2016 at 8:38 AM, priytam shukla <priytam....@gmail.com> wrote:
Hi Friends,

I am pretty new in the Nexus 3.0 and wanted to upload snapshot jar file into nexus default repository for learning and having dummy jar file "maven-artifact-9.1.1-SNAPSHOT.jar" which I have renamed  (not sure do I need to ).

I am using curl command to upload it as below :

curl -v -u username:password --upload-file "path of file\maven-artifact-9.1.1-SNAPSHOT.jar" http://hostname:8081/repository/maven-snapshots/org/apache/maven/plugins/maven-artifact/9.1.1-SNAPSHOT/maven-artifact-9.1.1-SNAPSHOT.jar

Path : "org/apache/maven/plugins/maven-artifact/9.1.1-SNAPSHOT" I have taken as read somewhere (not sure if it is correct)

after running it gets uploaded into repository maven-snapshots however it is not adding time stamp as it should which I have read in documentation.

I do not have any other file or something.Do I need to create POM file and upload it into same Repository before uploading jar file so going forward each time I upload the  the file with SNAPSHOT name it should append the time stamp.

Please help me creating POM file for above jar file.

Thank you !

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.



--
Thanks and Regards,
Priytam Shukla
+918600543173
Om SaiNath

Stuart McCulloch

unread,
Nov 15, 2016, 5:17:20 AM11/15/16
to priytam shukla, Nexus Users
Hi Priytam,

The URL should be a snapshot repository, for the basic Nexus 3 setup this would be:


for example:

mvn deploy:deploy-file -DgroupId=com.somecompany -DartifactId=project -Dversion=1.0.0-SNAPSHOT -DgeneratePom=false -Dpackaging=jar -DrepositoryId=nexus -Durl=http://localhost:8081/repository/maven-snapshots/ -DpomFile=pom.xml -Dfile=target/project-1.0.0-SNAPSHOT.jar

(you’ll need to adjust the URL if you’ve set a different context root or port, etc.)

You can also configure Nexus 3.1 to support the Nexus 2 style of content URLs such as:



(Note that this doesn’t cover “…/service/local/…” URLs which don’t exist in Nexus 3)

Hope this helps.

-- 
Cheers, Stuart
Reply all
Reply to author
Forward
0 new messages