Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download artifact from Nexus

Tags:

curl

maven

api

I am trying to download a nexus/maven artifact using curl or wget, but I always get an "403 - Forbidden".

URL: http://nexus.domain.com:8081/nexus/service/local/artifact/maven/redirect?r=snapshots&g=com.domain.org&c=dist-main&a=domain-server&v=LATEST&p=tar.gz

I tried using the following ip address, but it does not accept the credentials. The user exists, password is correct and have access to the repository. Does the user need special requirements?

curl -X GET -u user:password $URL

Or is there any way to use the api access key with curl? I am using Nexus 2.11.3.

Thanks.

like image 959
bert2002 Avatar asked Dec 09 '22 01:12

bert2002


1 Answers

you need to include -O parameter to download

curl -X GET -u user:password $URL -O

If you don't want the password to show in your history. This will prompt for a password

curl -X GET -u user $URL -O
like image 175
Dinesh Avatar answered Feb 01 '23 01:02

Dinesh