I am trying to use the nexus REST api to get the latest version of a maven artifact. I am able to browse to the specific version I am looking for using http://repo.loc
This answer has been copied from: https://stackoverflow.com/a/39485361/1450799
I have Linux OS and I do not have access to REST API, so I used following commands to get the latest version of snapshots from Nexus:
An example snapshots maven-metadata.xml from WSO2 repository:
$ curl -s "http://maven.wso2.org/nexus/content/repositories/snapshots/org/wso2/is/wso2is/maven-metadata.xml"
org.wso2.is
wso2is
5.3.0-SNAPSHOT
5.1.0-SNAPSHOT
5.2.0-SNAPSHOT
5.3.0-SNAPSHOT
20160914062755
Extracting from latest XML tag inside maven-metadata.xml:
curl -s "http://maven.wso2.org/nexus/content/repositories/snapshots/org/wso2/is/wso2is/maven-metadata.xml" | \
grep ".* " | \
sed -e "s#\(.*\)\(\)\(.*\)\( \)\(.*\)#\3#g"
Extracting from version XML tag inside maven-metadata.xml:
curl -s "http://maven.wso2.org/nexus/content/repositories/snapshots/org/wso2/is/wso2is/maven-metadata.xml" | \
grep ".* " | \
sort --version-sort | uniq | tail -n1 | \
sed -e "s#\(.*\)\(\)\(.*\)\( \)\(.*\)#\3#g"
The result of both of the commands until today 14 Sep 2016 is:
5.3.0-SNAPSHOT