Skip to content

Instantly share code, notes, and snippets.

@lielran
Created June 2, 2014 08:48
Show Gist options
  • Save lielran/d53b32b83ae04f44f35f to your computer and use it in GitHub Desktop.
Save lielran/d53b32b83ae04f44f35f to your computer and use it in GitHub Desktop.
Sonatype Nexus REST api
curl -o file-name.jar -u user:pass -L "http://maven.server.com:8081/nexus/service/local/artifact/maven/redirect?r=[Repository id e.g. snapshot]&g=[GROUP-ID]&a=[ARTIFACT-ID]&v=[Version e.g. LATEST]&p=[pkg e.g. jar/war/ear/...]"
r - parameter is the maven repository - e.g. snapshot/release/3rd party
g - parameter is the maven groupid -e.g. com.exelate.datalinx or com.exelate.bdi
a - parameter is the maven artifactid(name of the project) - e.g. datalinx-backend or data-processor
v - parameter - version number e.g. LATEST or 1.0.0 or 1.0.0-SNAPSHOT
wget --trust-server-names --user deployment --password build123 http://maven.server.com:8081/nexus/service/local/artifact/maven/redirect?r=[Repository id e.g. snapshot]\&g=[GROUP-ID]\&a=[ARTIFACT-ID]\&v=[Version e.g. LATEST]\&p=[pkg e.g. jar/war/ear/...]
or this:
wget --content-disposition --user deployment --password build123 http://maven.server.com:8081/nexus/service/local/artifact/maven/redirect?r=[Repository id e.g. snapshot]\&g=[GROUP-ID]\&a=[ARTIFACT-ID]\&v=[Version e.g. LATEST]\&p=[pkg e.g. jar/war/ear/...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment