0

How to create a link to get the latest release of an artifact? E.g. org.foo:bar would have 1.0 and 2.0, and the link would return the 2.0 release; and when 3.0 is released and deployed, the same link would return the 3.0 release, etc.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
Ondra Žižka
  • 424
  • 2
  • 5
  • 14

3 Answers3

1

I wouldn't use "LATEST" but if you want the latest release, you can ask with the "RELEASE" keyword:

http://somerepo.org/service/local/artifact/maven/redirect?r=central-proxy&g=groupId&a=artifactId&v=RELEASE

This will get you the latest given release, not just "LATEST" which will give you the last thing built (last thing uploaded for that group+artifact combo).

EJC
  • 121
  • 3
0

In nexus 3, according to official manual

You can download the archive by search download API:

http://${nexus host}/service/rest/v1/search/assets/download?repository={repoName}&group={group}&name=core&maven.baseVersion=x.x.x-SNAPSHOT&sort=version&direction=desc&maven.extension=jar

It will automatically sort by version field and fetch the latest one

The inner API list you can find in Manage UI > System > API, it is written by swagger

Stuggi
  • 3,366
  • 4
  • 17
  • 34
Kent
  • 31
  • 3
0

I have found about this kind of query:

http://somerepo.org/service/local/artifact/maven/redirect?r=central-proxy&g=groupId&a=artifactId&v=LATEST

But at the same time, a discouraging text explanation:

https://stackoverflow.com/questions/9280447/how-do-i-provide-url-access-to-the-latest-snapshot-of-an-artifact-in-nexus

So while this may work to some extent, it's not something really supported by Nexus.

Ondra Žižka
  • 424
  • 2
  • 5
  • 14