Home > OS >  Not able to download artifact from Nexus using curl
Not able to download artifact from Nexus using curl

Time:02-16

I am trying to download an artifact from Nexus Pro 3.37.3-02 using curl but it is not working. I have found below commands which I think working for many other but in my case I am getting repository, maven.groupId, maven.artifactId, maven.baseVersion, maven.extension is not recognized as internal or external command, operable program or batch files.

curl -u usename:password -L -X GET https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&maven.groupId=MY_GROUP&maven.artifactId=MY_ARTIFACT_NAME&maven.baseVersion=0.1-SNAPSHOT&maven.extension=zip

I have followed this documentation to make this command. https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api

Any help will be appreciated. Thanks,

CodePudding user response:

In case if anyone else facing the same problem then this is the solution which worked for me.

curl -u token:tokenPassword -L -X GET "https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&group=MY_GROUP&name=MY_ARTIFACT_NAME&version=MY_Version&maven.extension=zip" --output My_Artifact.zip
  • Related