Giorgio Giorgio - 1 year ago 311
reST (reStructuredText) Question

Sonatype Nexus REST Api fetch latest build version

How can I can use the Sonatype REST Api to fetch the build with the highest version (latest temporal build)?


Passing a build version as
works. Passing
does NOT return the latest build.

Answer Source

It is not documented that /service/local/lucene/search support "LATEST" as version parameter [link] The OSS rest api documentation states that /service/local/artifact/maven [link] (to get the artifact pom file) and /service/local/artifact/maven/content [link] (to get the actual file content) does support it:

Version of the artifact (Required) Supports resolving of "LATEST", "RELEASE" and snapshot versions ("1.0-SNAPSHOT") too.

So I think you should use one of them (you will have to supply them also with repositoryId and groupId) for example:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download