0

I have a Nexus server running on a linux VM on IP 192.168.56.2:8081. My repo in Nexus has the structure shown in the picture below. I am trying to download the latest snapshot artifact using wget and I'm using the command sudo wget --user=user --password=password "http://192.168.56.2:8081/nexus/service/local/artifact/maven/content?g=TestingJenkins&a=testingjenkins&v=1.0-SNAPSHOT&r=JENKINSTEST-SNAP" --content-disposition.

This gives me the error below:

--2019-07-11 02:22:18-- http://192.168.56.2:8081/nexus/service/local/artifact/maven/content?g=TestingJenkins&a=testingjenkins&v=1.0-SNAPSHOT&r=JENKINSTEST-SNAP Connecting to 192.168.56.2:8081... connected. HTTP request sent, awaiting response... 404 Not Found 2019-07-11 02:22:18 ERROR 404: Not Found.

Does anyone have any idea what might be the issue here? I have opened port 8081 on my firewall.

Nexus repo

PalBo
  • 2,203
  • 3
  • 22
  • 43
  • your curl query is valid for Nexus 2, mentioned here: https://stackoverflow.com/questions/9280447/how-do-i-provide-url-access-to-the-latest-snapshot-of-an-artifact-in-nexus-2-x, but the screenshot indicates that your are using Nexus 3, look at this question: https://stackoverflow.com/questions/41166741/nexus-3-how-to-get-latest-snapshot – Vladimir L. Jul 11 '19 at 07:58
  • Indeed you are right. Thank you. – PalBo Jul 11 '19 at 08:04

1 Answers1

1

Update: Nexus provides a Swagger UI with different API's, some of which can be used to download artifacts. The /v1/search/assets/download/ endpoint can be used to download a specified artifact with a curl query. Simply specify the name of your repository and some optional sorting parameter.

Nexus Swagger UI

PalBo
  • 2,203
  • 3
  • 22
  • 43