Issue
I'm currently trying to build some Docker Images through Dockerfiles. To do that, I need to get the newest build of an Maven Artifact from Nexus 3. But i can't seem to get the API call to work.
To get the following Artifact:
Repository: maven-releases
Group ID: eu.tuxcraft
Artifact ID: DatabaseProvider
Version: LATEST
Package Type: JAR
I use this URL
https://maven.tuxcraft.eu/nexus/service/local/artifact/maven/redirect?r=releases&g=eu.tuxcraft&a=DatabaseProvider&v=LATEST&p=jar
Is this the correct call, and if not, what URL do i need to use to get the Artifact?
Nexus Version: OSS 3.33.0.01
Solution
You’re trying to use the old Nexus Repo 2 API with Nexus Repo 3.x. See here for the new API:
https://help.sonatype.com/display/NXRM3/Search+API#SearchAPI-DownloadingtheLatestVersionofanAsset
Example:
curl -L -X GET "http://localhost:8081/service/rest/v1/search/assets/download?sort=version&repository=maven-snapshots&maven.groupId=org.foo.bar&maven.artifactId=project&maven.extension=jar" -H "accept: application/json"
Answered By - rseddon