Download latest snapshot artifact from Nexus Repository Manager OSS 3.30.0-01 using wget command

I am facing difficulty downloading the latest snapshot version from Nexus Repository Manager OSS 3.30.0-01 using wget command

since the format is maven artefacts snapshots version are appended with
timestamp along with build number.

so how to download the latest snapshot version from multiple version under one snapshot?

currently, I have to specify explicitly specify the version like the below one

wget http://$NEXUS_URL/repository/mfi-snapshots/com/mf/productService/1.0.9-SNAPSHOT/productService-1.0.9-20210329.141405-11.war

where
$NEXUS_URL: is the nexus URL
mfi-snapshots: is the snapshot repo
com.mf: is the group
productService is the artefact
1.0.9 SNAPSHOT the version of the artefact

i tried to use API “/v1/search/assets/download” ( not sure how to use it )
like the below

http://$NEXUS_URL/service/rest/v1/search/assets/download?sort=version&direction=desc&repository=mfi-snapshots&group=com.mf&name=productService

the format of the nexus is attached here with.

You can use the REST API for this:

https://help.sonatype.com/display/NXRM3/Search+API#SearchAPI-DownloadingtheLatestVersionofanAsset

1 Like

Thanks a lot, it helped