1

I want to download the artifacts of a project from command line with wget. The project has artifacts with different classifiers. But the classifier is not always equal and sometimes a project does not have any artifacts with classifer. The only one information, which i always get is the GAV coordinate of the projects.

When i specify the URL without the classifier and packaging, it responses with Error 404: Not Found.

URL="https://mynexus.com/nexus/service/local/artifact/maven/content?g=org.company&a=someproject&v=1.0.0&r=myrepository"
wget --user=$USER --password=$PASSWORD $URL

Is there any possiblity to get first a list of all classifiers of the project? Or to download all artifacts of the project with or without classifiers?

I searched in the documentation of the rest api, but i can't find a solution for my problem.

Oni1
  • 1,445
  • 2
  • 19
  • 39

1 Answers1

1

You can use the rest call

http://mynexus.com/nexus/service/local/lucene/search?a=servlet-api&g=javax.servlet&v=2.4

to get an XML-representation of the available artifacts.

By the way: It is easy find out suitable rest calls by using a program like Fiddler and examine the HTTP traffic.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • BUT this only works with the `Indexer Lucene Plugin`? – Oni1 Oct 17 '16 at 14:33
  • I don't think our nexus has plugins that are not shipped with nexus 2.14 itself. Have you tried the rest call? – J Fabian Meier Oct 17 '16 at 14:36
  • Yes locally on my test environment it works well.. But can i be sure, that every 2.x Nexus instances have this plugin installed? – Oni1 Oct 17 '16 at 14:42
  • I am pretty sure that this is the case - but if you want to test it, just download a nexus from the sonatype homepage, unpack it and start it. Then you have an easy way to compare. It does not need any installation and only requires a working jdk. – J Fabian Meier Oct 17 '16 at 14:47
  • Thank you for your answer. This is the solution to my question! – Oni1 Oct 17 '16 at 14:51
  • @JFMeier with Nexus Repository Manager with version 3.x this doesn't work... Do you know why? – Oni1 Nov 15 '16 at 13:32
  • @Oni1 I think they changed their rest api a lot. – J Fabian Meier Nov 16 '16 at 21:04