Migration to Maven 3.0.1 - Deploy fails with Error: 500 only for top most maven-metadata.xml
Asked Answered
G

1

6

I'm testing out migration to Maven 3.0.1 from 2.2.1.

All phases run fine except for the deploy phase.

When I first run with 2.2.1, everything runs fine.

Then I make the switch to 3.0.1 and run the same command and everything goes fine except for the top most maven-metadata.xml file. When maven tries to upload that file, I'm getting a http Error: 500.

If you notice in the log below:

This fails:

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

But this succeeds:

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

It surprises me that I'm not finding much information on this issue. Then again, maven 3 has been out only for about 8 months.

I found these two issues that I don't think are relevant to me: _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

I have also tried removing the old artifacts entirely from the 'artifactory' and deploying again.

I hope someone could point me in the right direction here.

I'm pasting the relevant info below.

Thanks in advance.

Here's the relevant portion of the console output:

[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

Here's the stack trace when I run it with the -X switch:

[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
Gatto answered 7/1, 2011 at 16:43 Comment(0)
G
7

I found the solution.

I had posted the question here as well

As pointed out by Benjamin here the problem is that the new metadata format that maven 3 uses causes problems with the old version of 'artifactory' we're using as our repository manager.

The solution is to use this parameter: -Dmaven.metadata.legacy=true

Gatto answered 7/1, 2011 at 21:34 Comment(1)
is there a way to set maven.metatada.legacy=true in the POM.xml file?Ly

© 2022 - 2024 — McMap. All rights reserved.