6

我正在测试从 2.2.1 迁移到 Maven 3.0.1。

除部署阶段外,所有阶段都运行良好。

当我第一次使用 2.2.1 运行时,一切运行良好。

然后我切换到 3.0.1 并运行相同的命令,除了最上面的 maven-metadata.xml 文件之外一切正常。当 maven 尝试上传该文件时,我收到一个 http 错误:500。

如果您在下面的日志中注意到:

这失败了:

Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml

但这成功了:

Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/maven-metadata.xml  

令我惊讶的是,我没有找到关于这个问题的太多信息。话又说回来,maven 3 只推出了大约 8 个月。

我发现这两个我认为与我无关的问题:_http://maven.40175.n5.nabble.com/Created-MSITE-531-Site-deployment-fails-on-googlecode-repository-unnecessary- WebDAV 中的路径元素--td3307584.html

_http://maven.40175.n5.nabble.com/Moved-WAGON-319-Site-deployment-fails-on-googlecode-repository-unnecessary-path-element-in-WebDAV-UR-td3308501.html

我还尝试从“工件”中完全删除旧工件并再次部署。

我希望有人可以在这里为我指明正确的方向。

我在下面粘贴相关信息。

提前致谢。

这是控制台输出的相关部分:

[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ThirdPartyDeploymentProject --- 
[INFO] Installing D:\PRIVATE\src\experiments\CIMM-Building\ThirdPartyDeploymentProject\target\ThirdPartyDeploymentProject-1-SNAPSHOT.jar to C:\Program Files\apache-maven-2.2.1\repo\com\***\deployment\ThirdPartyDeploymentProject\1-SNAPSHOT\ThirdPartyDeploymentProject-1-SNAPSHOT.jar 
[INFO] Installing D:\PRIVATE\src\experiments\CIMM-Building\ThirdPartyDeploymentProject\pom.xml to C:\Program Files\apache-maven-2.2.1\repo\com\***\deployment\ThirdPartyDeploymentProject\1-SNAPSHOT\ThirdPartyDeploymentProject-1-SNAPSHOT.pom 
[INFO] 
[INFO] --- maven-deploy-plugin:2.5:deploy (default-deploy) @ ThirdPartyDeploymentProject --- 
Downloading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/maven-metadata.xml
Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/ThirdPartyDeploymentProject-1-20110107.154227-1.jar
Uploaded: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/ThirdPartyDeploymentProject-1-20110107.154227-1.jar (3 KB at 18.4 KB/sec) 
Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/ThirdPartyDeploymentProject-1-20110107.154227-1.pom
Uploaded: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/ThirdPartyDeploymentProject-1-20110107.154227-1.pom (2 KB at 1.9 KB/sec) 
Downloading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/maven-metadata.xml
Downloaded: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/maven-metadata.xml (305 B at 0.4 KB/sec) 
Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/maven-metadata.xml
Uploading: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/maven-metadata.xml
Uploaded: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/maven-metadata.xml (341 B at 0.1 KB/sec) 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 7.891s 
[INFO] Finished at: Fri Jan 07 10:42:31 EST 2011 
[INFO] Final Memory: 9M/22M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project ThirdPartyDeploymentProject: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/1-SNAPSHOT/maven-metadata.xml. Return code is: 500 -> [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

这是我使用 -X 开关运行它时的堆栈跟踪:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project ThirdPartyDeploymentProject: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project ThirdPartyDeploymentProject: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:203) 
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) 
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140) 
        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:316) 
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153) 
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451) 
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188) 
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:134) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:597) 
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:189) 
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107) 
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195) 
        ... 19 more 
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:140) 
        at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:156) 
        ... 21 more 
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy metadata: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:273) 
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:329) 
        at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:136) 
        ... 22 more 
Caused by: org.sonatype.aether.transfer.MetadataTransferException: Could not transfer metadata com.***.deployment:ThirdPartyDeploymentProject:0.0.1-SNAPSHOT/maven-metadata.xml from/to deploymentRepoSnapshot (http://mvn.***.com:8080/artifactory/***-project-assets): Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:917) 
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:908) 
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:849)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:459) 
        at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:267) 
        ... 24 more 
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://mvn.***.com:8080/artifactory/***-project-assets/com/***/deployment/ThirdPartyDeploymentProject/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 500 
        at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:205) 
        at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:413) 
        at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392) 
        at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365) 
        at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163) 
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:810)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:458) 
        ... 25 more
4

1 回答 1

7

我找到了解决方案。

我也在这里发布了这个问题

正如 Benjamin在这里指出的那样,问题在于 maven 3 使用的新元数据格式会导致我们用作存储库管理器的旧版本“artifactory”出现问题。

解决方案是使用这个参数:-Dmaven.metadata.legacy=true

于 2011-01-07T21:34:07.313 回答