2011-01-07 33 views
6

我正在測試從2.2.1遷移到Maven 3.0.1。遷移到Maven 3.0.1 - 部署失敗,錯誤:500僅適用於最頂級的maven-metadata.xml

除了部署階段,所有階段都可以正常運行。

當我第一次運行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-path-element-in-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

我也嘗試完全從'artifactory'中刪除舊的工件並再次部署。

我希望有人能指出我在這裏正確的方向。

我在粘貼下面的相關信息。

在此先感謝。

這裏的控制檯輸出的相關部分:

[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 

回答

7

我找到了解決辦法。

我貼過這個問題here以及

正如指出的本傑明here問題是,Maven在3個使用新的元數據格式導致與老版「artifactory的」問題,我們使用的是作爲我們的資料庫經理。

的解決方案是使用這個參數:-Dmaven.metadata.legacy=true

+1

有沒有辦法來設置maven.metatada.legacy =在pom.xml文件是真的嗎? – 2011-10-19 11:21:18