maven-dependency-plugin:2.8:copy - 找不到工件

时间:2017-11-15 09:26:25

标签: maven nexus

我正在尝试从Ubuntu 14.04上的Nexus服务器下载工件,但是maven找不到它:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact.

在我的本地OS X机器上,它运行正常并下载预期的工件:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -X -Dartifact=com.myserver.myapp:myapp-backend:LATEST -DoutputDirectory=./ -Dmdep.useBaseVersion=true

哪个输出以下

Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-31-generic", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml
[DEBUG] Using local repository at /root/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /root/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Using mirror nexus (https://test.myserver.com:8443/repository/maven-public) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.apache.maven:standalone-pom:pom:1
[DEBUG] Tasks:   [org.apache.maven.plugins:maven-dependency-plugin:2.8:copy]
[DEBUG] Style:   Aggregating
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       org.apache.maven:standalone-pom:1
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [nexus (https://test.myserver.com:8443/repository/maven-public, releases)]
[DEBUG] Repositories (plugins)     : [nexus (https://test.myserver.com:8443/repository/maven-public, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <artifact>${artifact}</artifact>
  <local default-value="${localRepository}"/>
  <outputAbsoluteArtifactFilename default-value="false">${outputAbsoluteArtifactFilename}</outputAbsoluteArtifactFilename>
  <outputDirectory default-value="${project.build.directory}/dependency">${outputDirectory}</outputDirectory>
  <overWriteIfNewer default-value="true">${mdep.overIfNewer}</overWriteIfNewer>
  <overWriteReleases default-value="false">${mdep.overWriteReleases}</overWriteReleases>
  <overWriteSnapshots default-value="false">${mdep.overWriteSnapshots}</overWriteSnapshots>
  <prependGroupId default-value="false">${mdep.prependGroupId}</prependGroupId>
  <reactorProjects default-value="${reactorProjects}"/>
  <remoteRepos default-value="${project.remoteArtifactRepositories}"/>
  <silent default-value="false">${silent}</silent>
  <skip default-value="false">${mdep.skip}</skip>
  <stripClassifier default-value="false">${mdep.stripClassifier}</stripClassifier>
  <stripVersion default-value="false">${mdep.stripVersion}</stripVersion>
  <useBaseVersion default-value="false">${mdep.useBaseVersion}</useBaseVersion>
  <project default-value="${project}"/>
</configuration>
[DEBUG] =======================================================================
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:copy (default-cli) @ standalone-pom ---
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
... some imports ...
[DEBUG] org.apache.maven.plugins:maven-dependency-plugin:jar:2.8:
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-core:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[DEBUG]       commons-cli:commons-cli:jar:1.0:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[DEBUG]    org.apache.maven.reporting:maven-reporting-api:jar:3.0:compile
[DEBUG]    org.apache.maven.reporting:maven-reporting-impl:jar:2.0.5:compile
[DEBUG]       org.apache.maven.doxia:doxia-core:jar:1.0:compile
[DEBUG]       org.apache.maven.shared:maven-doxia-tools:jar:1.0.2:compile
[DEBUG]          commons-io:commons-io:jar:1.4:compile
[DEBUG]       commons-validator:commons-validator:jar:1.2.0:compile
[DEBUG]          commons-beanutils:commons-beanutils:jar:1.7.0:compile
[DEBUG]          commons-digester:commons-digester:jar:1.6:compile
[DEBUG]          commons-logging:commons-logging:jar:1.0.4:compile
[DEBUG]          oro:oro:jar:2.0.8:compile
[DEBUG]          xml-apis:xml-apis:jar:1.0.b2:compile
[DEBUG]    org.apache.maven.doxia:doxia-sink-api:jar:1.0:compile
[DEBUG]    org.apache.maven.doxia:doxia-site-renderer:jar:1.0:compile
[DEBUG]       org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile
[DEBUG]       org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile
[DEBUG]       org.apache.velocity:velocity:jar:1.5:compile
[DEBUG]       org.apache.maven.doxia:doxia-decoration-model:jar:1.0:compile
[DEBUG]       org.apache.maven.doxia:doxia-module-apt:jar:1.0:compile
[DEBUG]       org.apache.maven.doxia:doxia-module-fml:jar:1.0:compile
[DEBUG]       org.apache.maven.doxia:doxia-module-xdoc:jar:1.0:compile
[DEBUG]       org.apache.maven.doxia:doxia-module-xhtml:jar:1.0:compile
[DEBUG]    org.codehaus.plexus:plexus-archiver:jar:2.3:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.9:compile
[DEBUG]    org.apache.maven.shared:file-management:jar:1.2.1:compile
[DEBUG]       org.apache.maven.shared:maven-shared-io:jar:1.1:compile
[DEBUG]          org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6:compile
[DEBUG]    org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]       junit:junit:jar:3.8.1:compile
[DEBUG]    org.codehaus.plexus:plexus-io:jar:2.0.6:compile
[DEBUG]    org.apache.maven.shared:maven-dependency-analyzer:jar:1.4:compile
[DEBUG]       asm:asm:jar:3.3.1:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]    org.apache.maven.shared:maven-dependency-tree:jar:2.1:compile
[DEBUG]       org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
[DEBUG]    org.apache.maven.shared:maven-common-artifact-filters:jar:1.4:compile
[DEBUG]    org.apache.maven.shared:maven-invoker:jar:2.0.11:compile
[DEBUG]    commons-lang:commons-lang:jar:2.6:compile
[DEBUG]    commons-collections:commons-collections:jar:3.2.1:compile
[DEBUG]    classworlds:classworlds:jar:1.1:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG]   Included: org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:3.0
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-impl:jar:2.0.5
[DEBUG]   Included: org.apache.maven.doxia:doxia-core:jar:1.0
[DEBUG]   Included: org.apache.maven.shared:maven-doxia-tools:jar:1.0.2
[DEBUG]   Included: commons-io:commons-io:jar:1.4
[DEBUG]   Included: commons-validator:commons-validator:jar:1.2.0
[DEBUG]   Included: commons-beanutils:commons-beanutils:jar:1.7.0
[DEBUG]   Included: commons-digester:commons-digester:jar:1.6
[DEBUG]   Included: commons-logging:commons-logging:jar:1.0.4
[DEBUG]   Included: oro:oro:jar:2.0.8
[DEBUG]   Included: xml-apis:xml-apis:jar:1.0.b2
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0
[DEBUG]   Included: org.apache.maven.doxia:doxia-site-renderer:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7
[DEBUG]   Included: org.codehaus.plexus:plexus-velocity:jar:1.1.7
[DEBUG]   Included: org.apache.velocity:velocity:jar:1.5
[DEBUG]   Included: org.apache.maven.doxia:doxia-decoration-model:jar:1.0
[DEBUG]   Included: org.apache.maven.doxia:doxia-module-apt:jar:1.0
[DEBUG]   Included: org.apache.maven.doxia:doxia-module-fml:jar:1.0
[DEBUG]   Included: org.apache.maven.doxia:doxia-module-xdoc:jar:1.0
[DEBUG]   Included: org.apache.maven.doxia:doxia-module-xhtml:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:2.3
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.9
[DEBUG]   Included: org.apache.maven.shared:file-management:jar:1.2.1
[DEBUG]   Included: org.apache.maven.shared:maven-shared-io:jar:1.1
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-io:jar:2.0.6
[DEBUG]   Included: org.apache.maven.shared:maven-dependency-analyzer:jar:1.4
[DEBUG]   Included: asm:asm:jar:3.3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.apache.maven.shared:maven-dependency-tree:jar:2.1
[DEBUG]   Included: org.eclipse.aether:aether-util:jar:0.9.0.M2
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:1.4
[DEBUG]   Included: org.apache.maven.shared:maven-invoker:jar:2.0.11
[DEBUG]   Included: commons-lang:commons-lang:jar:2.6
[DEBUG]   Included: commons-collections:commons-collections:jar:3.2.1
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-dependency-plugin:2.8:copy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.8:copy' with basic configurator -->
[DEBUG]   (s) artifact = ch.myserver.myapp:myapp-backend:LATEST
[DEBUG]   (s) local =        id: local
      url: file:///root/.m2/repository/
   layout: none

[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = /home/nino
[DEBUG]   (s) overWriteIfNewer = true
[DEBUG]   (s) overWriteReleases = false
[DEBUG]   (s) overWriteSnapshots = false
[DEBUG]   (f) prependGroupId = false
[DEBUG]   (f) reactorProjects = [MavenProject: org.apache.maven:standalone-pom:1 @ ]
[DEBUG]   (s) remoteRepos = [       id: nexus
      url: https://test.myserver.com:8443/repository/maven-public
   layout: default
snapshots: [enabled => false, update => daily]
 releases: [enabled => true, update => daily]
]
[DEBUG]   (f) silent = false
[DEBUG]   (s) skip = false
[DEBUG]   (s) stripClassifier = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (s) useBaseVersion = true
[DEBUG]   (f) project = MavenProject: org.apache.maven:standalone-pom:1 @ 
[DEBUG] -- end configuration --
[INFO] Configured Artifact: ch.myserver.myapp:myapp-backend:LATEST:jar
[DEBUG] Could not find metadata ch.myserver.myapp:myapp-backend/maven-metadata.xml in local (/root/.m2/repository)
[DEBUG] Skipped remote update check for ch.myserver.myapp:myapp-backend/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata ch.myserver.myapp:myapp-backend:1.0-SNAPSHOT/maven-metadata.xml in local (/root/.m2/repository)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.090s
[INFO] Finished at: Wed Nov 15 10:01:44 CET 2017
[INFO] Final Memory: 9M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact. Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] 
[ERROR] ch.myserver.myapp:myapp-backend:jar:LATEST
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] nexus (https://test.myserver.com:8443/repository/maven-public, releases=true, snapshots=false)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
    at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:265)
    at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems(AbstractFromConfigurationMojo.java:171)
    at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.doExecute(CopyMojo.java:105)
    at org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST

Try downloading the file manually from the project website.

Then, install it using the command: 
    mvn install:install-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: 
    mvn deploy:deploy-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


  ch.myserver.myapp:myapp-backend:jar:LATEST

from the specified remote repositories:
  nexus (https://test.myserver.com:8443/repository/maven-public, releases=true, snapshots=false)

    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:219)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:157)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:525)
    at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:257)
    ... 24 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:213)
    ... 27 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
    ... 31 more
[ERROR] 
[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

settings.xml中的/root/.m2/

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>snapshots</id>
      <username>myusername</username>
      <password>mypassword</password>
   </server>
   <server>
      <id>releases</id>
      <username>myusername</username>
      <password>mypassword</password>
    </server>
  </servers>

  <mirrors>
     <mirror>
      <id>nexus</id>
      <url>https://test.myserver.com:8443/repository/maven-public</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
</settings>

我还尝试指定确切版本而不是LATEST,但这也不起作用。

我是否遗漏了一些文件或配置,或者问题出在这里?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。我需要通过-U

 -U,--update-snapshots                  Forces a check for missing
                                        releases and updated snapshots on
                                        remote repositories

所以:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -X -U -Dartifact=com.myserver.myapp:myapp-backend:LATEST -DoutputDirectory=./ -Dmdep.useBaseVersion=true