Select Page

Fetching artifact programmatically through REST/API in Nexus 3.x

Fetching artifact programmatically through REST/API in Nexus 3.x

There is so many case where it is desirable to pull down artifact from Sonatype #Nexus using REST API, unfortunately #Nexus 3.x Rest API are still under development…

Some use cases in Nexus 2.x:

  • You have a script that uses #REST call to pull down the LATEST maven artifacts every night from Nexus and deploys them.
  • You make extensive use of the #REST API in all your puppet modules
  • You use the #Atlassian #Puppet module for Nexus for creating repository, groups, assigning repository to groups, updating the main config settings, things like proxy, email, realms, and so on. The Puppet module is simply a wrapper over the Nexus REST API and allows to essentially import those abstractions into #Puppet Config Management

Here is one possible workaround that does not use any REST API mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.1:copy
-Dartifact=log4j:log4j:1.2.17:jar -DoutputDirectory=./

which is equivalent to Gist Link

About The Author

Cédric Walter

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.