download artifacts using wget in Nexus3 by constructing url using Maven GAV

1,267 views
Skip to first unread message

nan...@gmail.com

unread,
Nov 26, 2018, 9:09:09 PM11/26/18
to Nexus Users
How can we download artifacts from Nexus3 using wget?  Nexus 2.0’s REST API are pretty basic – construct a query URL based on Maven GAV info then run a wget command against that URL

Brian Fox

unread,
Nov 27, 2018, 8:46:53 AM11/27/18
to nan...@gmail.com, nexus...@glists.sonatype.com
It's the same in Nexus 3, what you're describing is the Maven Repo api which obviously can't change or Maven wouldn't work with it.

On Mon, Nov 26, 2018 at 9:09 PM <nan...@gmail.com> wrote:
How can we download artifacts from Nexus3 using wget?  Nexus 2.0’s REST API are pretty basic – construct a query URL based on Maven GAV info then run a wget command against that URL

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/273d01bd-c295-4d23-a206-584481c9a432%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

nan...@gmail.com

unread,
Nov 27, 2018, 10:48:22 AM11/27/18
to Nexus Users, nan...@gmail.com
I don't think it is working. This is what I'm looking for "http://nexus.com/nexus/service/local/artifact/maven/redirect?r=${REPO}&g=${GROUPID}&a=${ARTIFACTID}&e=${TYPE}&v=${VERSION}"

Do we have the same for Nexus3?

Michael Prescott

unread,
Nov 27, 2018, 10:58:03 AM11/27/18
to nan...@gmail.com, nexus...@glists.sonatype.com
The NXRM 3 endpoint you're looking for is:

<nxrm>/service/rest/v1/search/assets/download

The parameters are very similar, and are described (along with all the other REST endpoints) in the built-in swagger console, which you can find at:

<nxrm>/#admin/system/api

mke...@sonatype.com

unread,
Nov 27, 2018, 10:58:36 AM11/27/18
to Nexus Users, nan...@gmail.com

nan...@gmail.com

unread,
Nov 27, 2018, 11:22:24 AM11/27/18
to Nexus Users, nan...@gmail.com
Thank you all! I will give it a try and let you know.

nan...@gmail.com

unread,
Nov 27, 2018, 2:18:27 PM11/27/18
to Nexus Users, nan...@gmail.com
Not an easy way to get the latest snapshot version, I will have to write some custom script to fetch the latest snapshot version. Any easy way of getting the latest version from the snapshot?
Reply all
Reply to author
Forward
0 new messages