Search code examples
javamavennexusnexus3

Sonatype Nexus 3 - get latest snapshot


We've just upgraded out nexus installation to the latest release (3.x). Is there any way to get the latest version of a given snapshot artifact? Nexus 2 had a nice API which is not supported anymore.

Same question (but for the old version) has been answered here: Sonatype Nexus REST Api fetch latest build version

Any ideas are highly appreciated.

Best, Daniel


Solution

  • Asof April 2019 there IS a REST API in Sonatype Nexus 3 for accessing the latest artefact

    Documentation is here

    http://community.sonatype.com/t/nxrm-3-16-rest-search-and-filtering-enhancements/1586

    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.

    https://nexus.blahblah.com/service/rest/v1/search/assets/download?repository=maven-snapshots&group=com.my.company&name=myArtefact&sort=version&direction=desc