[ACCEPTED]-How do I provide URL access to the latest snapshot of an artifact in Nexus 2.x?-nexus
Please note
- this answer relates to Nexus 2.X
- There is a noticeable performance impact of using the restlet API to download large artifacts, see: https://community.sonatype.com/t/slow-artefacts-download-performance-with-oss-2-x/2280
The core Nexus "redirect" REST API can 8 be used to retrieve any version of an artifact 7 from a nominated repository:
For example:
The 6 v parameter can be a value like 1.0-SNAPSHOT, in 5 which case Maven will return the latest 4 time-stamped snapshot held in the repository. Similiarily 3 the special value "LATEST" should 2 do the same provided a more recent released 1 version is not present.
on my nexus machine all results for :
are 9 like this: *-1.2.3-20131204.143026-1.zip
so 8 I can't access it directly because I need 7 to provide more details that are dynamic.
The 6 example with "...redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST" is 5 working if I open in browser but not when 4 I what to install it from some linux machine 3 using:
/usr/share/elasticsearch/bin/plugin --url "http://localhost:8081/nexus/service/local/artifact/maven/redirect?r=snapshots&g=com.comapny.application&a=elasticsearch-river-mongodb&v=1.2.3-SNAPSHOT&p=zip" --install river-mongodb
So my temporary solution is using 2 wget :
wget -O /tmp/elasticsearch-river-mongodb.zip "http://nexushost.domain/nexus/service/local/artifact/maven/redirect?r=snapshots&g=com.comapny.application&a=elasticsearch-river-mongodb&v=1.2.3-SNAPSHOT&p=zip"
then install LATEST version from local 1 file.
If you're looking for the latest version 17 of a snapshot, just asking for say, "1.0-SNAPSHOT" will 16 return the latest version of that artifact's 15 snapshot.
If you're looking for "latest version" however, the 14 "v=LATEST" syntax will work, but keep in 13 mind that this keyword can return the latest 12 version of that snapshot you're looking 11 for, or the release that just completed, or 10 that OTHER branch of that same artifact 9 that is a version ahead and still at "-SNAPSHOT".
If 8 you're looking for the absolute latest then 7 yeah, use the "v=LATEST". If you're looking 6 for the latest release, you can also ask 5 for "v=RELEASE". If you have a grouping 4 of repos, you can reference both snapshot 3 repos and release repositories by adding 2 to the url something like:
"...v=RELEASE&r=public"
That 1 should search across all your "grouped" repos.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.