Latest snapshot artifact version from snapshot repository through API

latest-snapshot

#1

Hi There,

Actually I am trying to implement component tagging feature and in order to achieve this I need artifact version of component just got upload to nexus.

Problem with me is I am not able to get version for sanpshot artifacts because during nexus upload the -SNAPSHOT part gets replace by current timestamp.

In nexus2 we have API to get version of latest SNAPSHOT artifact present inside repository.
When we are going to get the same in Nexsu3 or do we have any alternative to get the sanpshot version?


#2

If you are willing to do a little scripting you can probably duplicate this functionality on your own. The maven.baseVersion parameter can be used via the REST API to get a list of all current SNAPSHOT versions stored by nexus repository manager 3. You then just have to sort those results by timestamp and grab the latest version.

http://localhost:1234/service/rest/v1/search?maven.baseVersion=1.0.0-SNAPSHOT


#3

Thanks for this idea.

Do you know when we will be able to get API for the same as we have previously in Nexus 2?


#4

We’ll be releasing a version of this feature in 3.16 which should be just around the corner. We’ll make more information available once the release is completed but the short version is that we added sort, direction, and prerelease flags to the /search, /search/assets, and /search/assets/download endpoints to aid in finding the latest version of an artifact.