<Code:bash>
curl –user user:password -sSL -X GET -G “https://nexus.url/service/rest/v1/search/assets” \
d repository=maven-snapshots \
d maven.groupId=info.elsener \
d maven.artifactId=artifact \
d maven.baseVersion=1.0.0-SNAPSHOT \
d maven.extension=zip \
d maven.classifier=bin \
| grep -Po '“downloadUrl” : “\K.+(?=”,)' \
| sort \
| tail -1 \
| xargs curl --user user:password -fsSL -o /tmp/artifact-bin.zip
</Code>
Get all artifact information for base version
extract download urls
sort urls (there is a timestamp in)
get last entry
download artifact