org.apache.maven.plugin.MojoExecutionException: Error deploying artifact: Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400

Sonatype JIRA | Oren Livne | 7 years ago
  1. 0

    - Using maven 3.0-SNAPSHOT - settings.xml contains: <servers> <server> <id>nexus</id> <username>deployment</username> <password>****</password> </server> </servers> - When typing "mvn deploy -N -X" for our artifact (edu.utah.further:further:pom), an HTTP 400 error is returned: [ERROR] [0] org.apache.maven.plugin.MojoExecutionException: Error deploying artifact: Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400 at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:195) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:547) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:102) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:421) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:156) at org.apache.maven.cli.MavenCli.main(MavenCli.java:121) 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.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400 at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:85) at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:165) ... 16 more Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400 at org.apache.maven.wagon.providers.http.LightweightHttpWagon.put(LightweightHttpWagon.java:172) at org.apache.maven.repository.legacy.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:496) at org.apache.maven.repository.legacy.DefaultWagonManager.putArtifact(DefaultWagonManager.java:450) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:75) ... 17 more [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [0] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException - The deployment user has the proper role. What is the proper way to set up staging? I followed thr instructions in the book but that doesn't seem to work. Thank you in advance.

    Sonatype JIRA | 7 years ago | Oren Livne
    org.apache.maven.plugin.MojoExecutionException: Error deploying artifact: Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400
  2. 0

    Scenario: We have several sets of Java OSGi services with a parent pom and 4 child projects/poms. The parent pom does not generate any JARs, but each of the children generates a jar.Something like the following: {noformat} project_folder/ |_servicename.business/ | \_pom.xml |_servicename.jms/ | \_pom.xml |_servicename.model/ | \_pom.xml |_servicename.webservice/ | \_pom.xml \_pom.xml {noformat} Each of these services is setup as a separate Jenkins job, and the maven dependencies are turned on so they all build in the appropriate order. Within the parent pom we have our <distributionManagement> section defined so we can run the mvn deploy goals to upload artifacts to our maven repository. Up until this point we have only been building SNAPSHOTS, for which the Nexus repository allows redeploying of artifacts. WHAT IS GOING WRONG: The other day we tried to build our first release version of some of the services, and the deployment into the Nexus maven repository failed on the "Deploy artifacts to Maven repository" task. Looking at the Console Output of the failed job, for some reason Jenkins is trying to deploy the parent POM a second time. Nexus refuses this, as it does not allow redeploying of release artifacts. Below is an excerpt from the output of one of those jobs: {quote} [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 52.240s [INFO] Finished at: Thu Oct 06 14:55:37 GMT 2011 [INFO] Final Memory: 63M/151M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote maven settings from : /opt/maven/conf/settings.xml [ERROR] uniqueVersion == false is not anymore supported in maven 3 [INFO] Deployment in dav:http://maven.luthresearch.net/nexus/content/repositories/releases/ (id=com.luthresearch,uniqueVersion=false) Deploying the main artifact savvyconnect-1.0.1.pom Uploading: dav:http://maven.luthresearch.net/nexus/content/repositories/releases/com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom Uploaded: dav:http://maven.luthresearch.net/nexus/content/repositories/releases/com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom (3 KB at 24.4 KB/sec) Uploading: http://maven.luthresearch.net/nexus/content/repositories/releases/com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom ERROR: Failed to deploy artifacts: Could not transfer artifact com.luthresearch.savvyconnect:savvyconnect:pom:1.0.1 from/to com.luthresearch (dav:http://maven.luthresearch.net/nexus/content/repositories/releases/): Failed to transfer file: http://maven.luthresearch.net/nexus/content/repositories/releases//com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom. Return code is: 400 org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.luthresearch.savvyconnect:savvyconnect:pom:1.0.1 from/to com.luthresearch (dav:http://maven.luthresearch.net/nexus/content/repositories/releases/): Failed to transfer file: http://maven.luthresearch.net/nexus/content/repositories/releases//com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom. Return code is: 400 at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:158) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:693) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:668) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:987) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:615) at hudson.model.Run.run(Run.java:1428) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:478) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.luthresearch.savvyconnect:savvyconnect:pom:1.0.1 from/to com.luthresearch (dav:http://maven.luthresearch.net/nexus/content/repositories/releases/): Failed to transfer file: http://maven.luthresearch.net/nexus/content/repositories/releases//com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom. Return code is: 400 at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:284) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 11 more Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.luthresearch.savvyconnect:savvyconnect:pom:1.0.1 from/to com.luthresearch (dav:http://maven.luthresearch.net/nexus/content/repositories/releases/): Failed to transfer file: http://maven.luthresearch.net/nexus/content/repositories/releases//com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom. Return code is: 400 at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:864) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:466) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:278) ... 14 more Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://maven.luthresearch.net/nexus/content/repositories/releases//com/luthresearch/savvyconnect/savvyconnect/1.0.1/savvyconnect-1.0.1.pom. Return code is: 400 at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:368) at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:280) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:825) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:465) ... 15 more [INFO] Deployment failed after 0.27 sec Build step 'Deploy artifacts to Maven repository' changed build result to FAILURE Sending e-mails to: devstaff@luthresearch.com Finished: FAILURE {quote} CONFIRMATION OF ISSUE: I logged into the build server, went to the project in the Jenkins workspace, deleted the existing release artifacts from the maven repository, and manually ran the mvn deploy goal. It succeeded in uploading all of the artifacts including the JARs. WORKAROUND: I disabled the "Post-Build Actions"->"Deploy artifacts to Maven repository." I then setup a "Post Steps"->"Invoke top-level Maven target" task with the Maven goal of "deploy". (I believe this functionality is provided by the Jenkins M2 Extra Steps Plugin. https://wiki.jenkins-ci.org/display/JENKINS/M2+Extra+Steps+Plugin) Using the post build step to execute the deploy goal succeeds in successfully uploading all of the artifacts.

    Jenkins JIRA | 5 years ago | Michael Rasmussen
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact org.metcox.lab.jenkins:simplePom:pom:1.0.0 from/to releases (http://localhost:8081/nexus/content/repositories/releases): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/org/metcox/lab/jenkins/simplePom/1.0.0/simplePom-1.0.0.pom. Return code is: 400, ReasonPhrase:Bad Request.
  3. 0

    [JIRA] Created: (JENKINS-11248) Build fails on "Deploy artifacts to Maven repository" due to trying to upload parent POM twice for release artifacts

    Google Groups | 5 years ago | mrasm...@luthresearch.com (JIRA)
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact org.metcox.lab.jenkins:simplePom:pom:1.0.0 from/to releases (http://localhost:8081/nexus/content/repositories/releases): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/org/metcox/lab/jenkins/simplePom/1.0.0/simplePom-1.0.0.pom. Return code is: 400, ReasonPhrase:Bad Request.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Why am I getting a “401 Unauthorized” error in Maven?

    laihaomi.com | 1 year ago
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
  6. 0

    Why am I getting a "401 Unauthorized" error in Maven?

    Stack Overflow | 2 years ago | aliteralmind
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.maven.wagon.TransferFailedException

      Failed to transfer file: http://dev-tools.further.utah.edu/nexus/service/local/staging/deploy/maven2/edu/utah/further/further/1.0.0-SNAPSHOT/further-1.0.0-20091106.223534-1.pom. Return code is: 400

      at org.apache.maven.wagon.providers.http.LightweightHttpWagon.put()
    2. Maven
      LightweightHttpWagon.put
      1. org.apache.maven.wagon.providers.http.LightweightHttpWagon.put(LightweightHttpWagon.java:172)
      1 frame
    3. Maven Compat
      DefaultWagonManager.putArtifact
      1. org.apache.maven.repository.legacy.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:496)
      2. org.apache.maven.repository.legacy.DefaultWagonManager.putArtifact(DefaultWagonManager.java:450)
      2 frames
    4. Maven
      DefaultArtifactDeployer.deploy
      1. org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:75)
      1 frame
    5. org.apache.maven
      DeployMojo.execute
      1. org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:165)
      1 frame
    6. Maven Plugin
      DefaultBuildPluginManager.executeMojo
      1. org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
      1 frame
    7. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:547)
      2. org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
      3. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
      4. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:102)
      4 frames
    8. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:421)
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:156)
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
      3 frames
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    10. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      4 frames