I am trying to use the nexus REST api to get the latest version of a maven artifact. I am able to browse to the specific version I am looking for using http://repo.local/service/local/data_index?a=local-turbogears-server&from=0&g=com.turbo&c=bin&v=1.1.9
and if I remove the version parameter I can see every version. However when I try and use RELEASE or LATEST as the version then it returns zero results. I checked the maven-metadata.xml on disk in nexus and there are entries for latest and release. Is there another step I need to take to return the latest version?
I am currently using:
Nexus v. 1.9.2
Use this endpoint /service/rest/v1/search/assets/download with repository , group and name arguments. Sorting by version will get you the latest timestamped snapshot.
Snapshot artifacts are artifacts generated during the development of a software project. A Snapshot artifact has both a version number such as “1.3. 0” or “1.3” and a timestamp in its name.
Nexus Repository leverages Open API to document the REST API. To make it easier to consume, we ship Nexus Repository with Swagger UI - a simple, interactive user interface, where parameters can be filled out and REST calls made directly through the UI to see the results in the browser.
The following URL will retrieve the latest version of log4j 1.2.x:
http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST
Documented here
Example using curl:
curl -L "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST" -o log4j.jar
Log4j 1.2 is EOL since summer 2015 and is known to be broken in Java 9.
Here is the link for the Log4j artifacts:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With