The latest version of the artifact from Apache Archiva

Is there any parameterized url on archiva where I can get the latest snapshot / release of the artifact? I like https://myhappyarchiva.com/archiva/repository/com.example/com/example/myproject/LATEST/myproject-LATEST.jar

+4
source share
2 answers

This feature is not yet available, however you may need to point out the problem at http://jira.codehaus.org/browse/MRM . A related issue is http://jira.codehaus.org/browse/MRM-805 .

To achieve this today, it is best to do the following:

  • use the XMLRPC interface to extract versions and select the latest ones (you can use the Maven libraries for this, if it is for Maven) [ 1 ] [ 2 ]
  • If you know that the repository will be a Maven repository, you can grab the maven-metadata.xml file from Archiva and read the <release> or <latest> element
+2
source

Try something like: " http://myhappyarchiva.com/archiva/restServices/archivaServices/searchService/artifact?r=#releases&g=com.myhappyarchiva&a=myproject&v=LATEST "

Basics: " http: // [host_name] / archiva / restServices / archivaServices / searchService / artifact? R = [release_option] & g = [group_id] & a = [artifact_id] & v = [version] & c = [classifer] "

  • [hostname]: dev.foo.com
  • [release_option] is similar: "snapshots" or "releases"
  • [group_id] looks like: com.foo
  • [version] is similar: LATEST or some number, for example 1.0
  • [classifer] similar: javadoc, sources or assembly

Labels are displayed in archive tables. This way you can easily find links.

I believe you can use "p" for packaging. It can be like "jar", "pom", "javadoc" basically file types. So it will look like "& p = jar" is added to the request.

It is you who follow requests that sometimes go through temporary redirects 307 and 302 detect the redirection before the repo download starts.

You do this with curl or wget. Or in a script (I made a ruby ​​script).

Wget example: https://archiva.apache.org/docs/2.2.0/userguide/querying-artifacts.html

+3
source

All Articles