1

I am trying to pull the latest artifact from my Nexus repository. I am using the get command to pull the artifact.

mvn dependency:get -Durl=http://nexus-repository:8080/nexus/content/repositories/snapshots -Dartifact=com.my.company:common:LATEST-Dtransitive=false -Ddest=. -s settings.xml

And it is the error message I am getting.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Failed to resolve version for com.my.company:common:jar:LATEST: Could not find metadata com.my.company:common/maven-metadata.xml in releases (http://nexus-repository:8080/nexus/content/repositories/releases)

I do not know either why it is looking on release and not in snapshots because the version is on my snapshots repository.

When I run with the specific version everything works fine:

mvn dependency:get -Durl=http://nexus-repository:8080/nexus/content/repositories/snapshots -Dartifact=com.my.company:common:1.0.0-SNAPSHOT -Dtransitive=false -Ddest=. -s settings.xml

I will like to pull the latest version using mvn command and not curl neither wget.

Any recommendation or idea?

Robert
  • 10,403
  • 14
  • 67
  • 117
  • Which version of nexus and maven are you using. It seems that LATEST and RELEASE are deprecated (see: https://issues.apache.org/jira/browse/MNG-6206), maybe newer versions of nexus do not handle that kind of version string correctly. – DrHopfen May 15 '18 at 16:00
  • @DrHopfen I am using **maven 3.3.9** and Nexus **2.14.7** – Robert May 15 '18 at 16:43
  • If you use the last command you should add a `-U` to the Maven command and it should do exactly what you like? – khmarbaise May 15 '18 at 19:00
  • 1
    with that option the error message is ```Couldn't download artifact: Failed to resolve version for com.my.company:common:jar:LATEST: Could not find metadata com.my.company:common/maven-metadata.xml``` – Robert May 15 '18 at 19:53

0 Answers0