[ https://issues.apache.org/jira/browse/MDEP-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
WestFarmer updated MDEP-704: ---------------------------- Description: Does copy respect LATEST as version, actually ? I can download a specific version, but not the 'latest' version, see logs below. however, in modern CI/CD pipelines, we sometimes need to get latest artifact. [ggfan@localhost nexus]$ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:0.0.9:kar:bundle -DoutputDirectory=. [INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- maven-dependency-plugin:3.1.2:copy (default-cli) @ standalone-pom --- [INFO] Configured Artifact: org.sonatype.nexus.plugins:nexus-repository-apk:bundle:0.0.9:kar Downloading from bgzchina-maven-releases: http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom Downloading from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom Downloaded from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom (2.5 kB at 758 B/s) Downloading from bgzchina-maven-releases: http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom Downloading from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom Downloaded from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom (5.0 kB at 1.7 kB/s) Downloading from bgzchina-maven-releases: http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar Downloading from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar Downloaded from bgzchina-maven-proxy: http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar (588 kB at 48 kB/s) [INFO] Copying nexus-repository-apk-0.0.9-bundle.kar to /home/ggfan/Desktop/fwx/raw/nexus/nexus-repository-apk-0.0.9-bundle.kar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.063 s [INFO] Finished at: 2020-06-16T22:15:01+08:00 [INFO] ------------------------------------------------------------------------ [ggfan@localhost nexus]$ ls '${project.basedir}' build.sh deployment.yaml Dockerfile keycloak-intergration nexus-repository-apk-0.0.10-bundle.kar nexus-repository-apk-0.0.9-bundle.kar upstream [ggfan@localhost nexus]$ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:LATEST:kar:bundle -DoutputDirectory=. [INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- maven-dependency-plugin:3.1.2:copy (default-cli) @ standalone-pom --- [INFO] Configured Artifact: org.sonatype.nexus.plugins:nexus-repository-apk:bundle:LATEST:kar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.877 s [INFO] Finished at: 2020-06-16T22:15:40+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (default-cli) on project standalone-pom: Unable to find/resolve artifact.: Failed to read artifact descriptor for org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST: Failed to resolve version for org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException was: {noformat} {noformat} *[ggfan@localhost nexus]$ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:LATEST:kar:bundle* *[INFO] Scanning for projects...* *[INFO]* *[INFO] ------------------< org.apache.maven:standalone-pom >-------------------* *[INFO] Building Maven Stub Project (No POM) 1* *[INFO] --------------------------------[ pom ]---------------------------------* *[INFO]* *[INFO] --- maven-dependency-plugin:3.1.2:get (default-cli) @ standalone-pom ---* *[INFO] Resolving org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST with transitive dependencies* *[INFO] ------------------------------------------------------------------------* *[INFO] BUILD FAILURE* *[INFO] ------------------------------------------------------------------------* *[INFO] Total time: 0.948 s* *[INFO] Finished at: 2020-06-16T22:07:07+08:00* *[INFO] ------------------------------------------------------------------------* *[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get (default-cli) on project standalone-pom: Couldn't download artifact: org.eclipse.aether.resolution.DependencyResolutionException: Failed to read artifact descriptor for org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST: Failed to resolve version for org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST -> [Help 1]* *[ERROR]* *[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.* *[ERROR] Re-run Maven using the -X switch to enable full debug logging.* *[ERROR]* *[ERROR] For more information about the errors and possible solutions, please read the following articles:* *[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException* *[ggfan@localhost nexus]$ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:0.0.10:kar:bundle* *[INFO] Scanning for projects...* *[INFO]* *[INFO] ------------------< org.apache.maven:standalone-pom >-------------------* *[INFO] Building Maven Stub Project (No POM) 1* *[INFO] --------------------------------[ pom ]---------------------------------* *[INFO]* *[INFO] --- maven-dependency-plugin:3.1.2:get (default-cli) @ standalone-pom ---* *[INFO] Resolving org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:0.0.10 with transitive dependencies* *[INFO] ------------------------------------------------------------------------* *[INFO] BUILD SUCCESS* *[INFO] ------------------------------------------------------------------------* *[INFO] Total time: 0.925 s* *[INFO] Finished at: 2020-06-16T22:07:23+08:00* *[INFO] ------------------------------------------------------------------------* > download latest artifact failed > -------------------------------- > > Key: MDEP-704 > URL: https://issues.apache.org/jira/browse/MDEP-704 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: copy > Affects Versions: 3.1.2 > Environment: Apache Maven 3.6.3 > (cecedd343002696d0abb50b32b541b8a6ba2883f) > Maven home: /home/ggfan/1-install/maven/apache-maven-3.6.3 > Java version: 1.8.0_252, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-0.fc31.x86_64/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.5.9-200.fc31.x86_64", arch: "amd64", family: > "unix" > Reporter: WestFarmer > Priority: Major > > Does copy respect LATEST as version, actually ? > I can download a specific version, but not the 'latest' version, see logs > below. however, in modern CI/CD pipelines, we sometimes need to get latest > artifact. > [ggfan@localhost nexus]$ mvn > org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy > -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:0.0.9:kar:bundle > -DoutputDirectory=. > [INFO] Scanning for projects... > [INFO] > [INFO] ------------------< org.apache.maven:standalone-pom > >------------------- > [INFO] Building Maven Stub Project (No POM) 1 > [INFO] --------------------------------[ pom > ]--------------------------------- > [INFO] > [INFO] --- maven-dependency-plugin:3.1.2:copy (default-cli) @ standalone-pom > --- > [INFO] Configured Artifact: > org.sonatype.nexus.plugins:nexus-repository-apk:bundle:0.0.9:kar > Downloading from bgzchina-maven-releases: > http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom > Downloading from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom > Downloaded from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9.pom > (2.5 kB at 758 B/s) > Downloading from bgzchina-maven-releases: > http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom > Downloading from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom > Downloaded from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/apk-parent/0.0.9/apk-parent-0.0.9.pom > (5.0 kB at 1.7 kB/s) > Downloading from bgzchina-maven-releases: > http://172.31.0.187:8081/repository/maven-bgzchina-releases/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar > Downloading from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar > Downloaded from bgzchina-maven-proxy: > http://172.31.0.187:8081/repository/central-aliyun/org/sonatype/nexus/plugins/nexus-repository-apk/0.0.9/nexus-repository-apk-0.0.9-bundle.kar > (588 kB at 48 kB/s) > [INFO] Copying nexus-repository-apk-0.0.9-bundle.kar to > /home/ggfan/Desktop/fwx/raw/nexus/nexus-repository-apk-0.0.9-bundle.kar > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 20.063 s > [INFO] Finished at: 2020-06-16T22:15:01+08:00 > [INFO] > ------------------------------------------------------------------------ > [ggfan@localhost nexus]$ ls > '${project.basedir}' build.sh deployment.yaml Dockerfile > keycloak-intergration nexus-repository-apk-0.0.10-bundle.kar > nexus-repository-apk-0.0.9-bundle.kar upstream > [ggfan@localhost nexus]$ mvn > org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy > -Dartifact=org.sonatype.nexus.plugins:nexus-repository-apk:LATEST:kar:bundle > -DoutputDirectory=. > [INFO] Scanning for projects... > [INFO] > [INFO] ------------------< org.apache.maven:standalone-pom > >------------------- > [INFO] Building Maven Stub Project (No POM) 1 > [INFO] --------------------------------[ pom > ]--------------------------------- > [INFO] > [INFO] --- maven-dependency-plugin:3.1.2:copy (default-cli) @ standalone-pom > --- > [INFO] Configured Artifact: > org.sonatype.nexus.plugins:nexus-repository-apk:bundle:LATEST:kar > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD FAILURE > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 0.877 s > [INFO] Finished at: 2020-06-16T22:15:40+08:00 > [INFO] > ------------------------------------------------------------------------ > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (default-cli) on > project standalone-pom: Unable to find/resolve artifact.: Failed to read > artifact descriptor for > org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST: Failed to > resolve version for > org.sonatype.nexus.plugins:nexus-repository-apk:kar:bundle:LATEST -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException -- This message was sent by Atlassian Jira (v8.3.4#803005)