Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9084

Regression in jenkins .401 maven plugin - deploy to repository post-task

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None
    • jenkins .401

      After upgrading to latest jenkins .401 the post-build task deploy to maven repository has resurfaced:

      Failed to transfer file: http://xxxx/nexus/content/repositories/snapshots/some/artifact-1.2-20110317.153602-23.pom. Return code is: 401

      This worked before upgrading.
      I put in the url to deploy to + the server id in settings.xml containing the credentials

          [JENKINS-9084] Regression in jenkins .401 maven plugin - deploy to repository post-task

          Since the last Jenkins upgrade to 1.442, all our maven jobs
          are failing during the post-build deploy to repository step. Nothing has changed in the maven configuration. The
          repositoy manager (nexus) seems OK as I can still deploy artifacts when
          running a mvn deploy on the same machine where Jenkins is running. Following is the "anonymized"
          stacktrace of a failing jenkins job :

          [INFO]
          ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO]
          ------------------------------------------------------------------------
          [INFO] Total time: 20 seconds
          [INFO] Finished at: Wed Dec 07 10:50:54 CET 2011
          [INFO] Final Memory: 25M/61M
          [INFO]
          ------------------------------------------------------------------------
          channel stopped
          Maven RedeployPublished use remote  maven settings from : /var/lib/
          jenkins/.m2/settings.xml
          [INFO] Deployment in http://my-server/snapshots (id=my-company-
          snapshots,uniqueVersion=true)
          Déploiement de l'artefact principal my-artifact-0.0.2-SNAPSHOT.jar
          Downloading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/maven-metadata.xml
          Downloaded: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/maven-metadata.xml
          (789 B at 8.4 KB/sec)
          Uploading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar
          Uploading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.pom
          ERROR: Failed to deploy artifacts: Could not transfer artifact com.my-
          company:my-artifact:jar:0.0.2-20111207.095055-6 from/to my-company-
          snapshots (http://my-server/snapshots): Failed to transfer file:
          http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar.
          Return code is: 401
          org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed
          to deploy artifacts: Could not transfer artifact com.my-company:my-
          artifact:jar:0.0.2-20111207.095055-6 from/to my-company-snapshots
          (http://my-server/snapshots): Failed to transfer file:
          http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar.
          Return code is: 401
                 at
          org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:
          141)
                 at
          hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:
          182)
                 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:692)
                 at hudson.model.AbstractBuild
          $AbstractRunner.performAllBuildSteps(AbstractBuild.java:667)
                 at hudson.maven.MavenModuleSetBuild
          $RunnerImpl.post2(MavenModuleSetBuild.java:1014)
                 at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:
          614)
                 at hudson.model.Run.run(Run.java:1429)
                 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
                 at hudson.model.ResourceController.execute(ResourceController.java:
          88)
                 at hudson.model.Executor.run(Executor.java:238)
          Caused by: org.sonatype.aether.deployment.DeploymentException: Failed
          to deploy artifacts: Could not transfer artifact com.my-company:my-
          artifact:jar:0.0.2-20111207.095055-6 from/to my-company-snapshots
          (http://my-server/snapshots): Failed to transfer file:
          http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar.
          Return code is: 401
                 at
          org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:
          280)
                 at
          org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:
          211)
                 at
          org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:
          443)
                 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.my-company:my-artifact:jar:
          0.0.2-20111207.095055-6 from/to my-company-snapshots (http://my-server/
          snapshots): Failed to transfer file:
          http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar.
          Return code is: 401
                 at org.sonatype.aether.connector.wagon.WagonRepositoryConnector
          $4.wrap(WagonRepositoryConnector.java:950)
                 at org.sonatype.aether.connector.wagon.WagonRepositoryConnector
          $4.wrap(WagonRepositoryConnector.java:940)
                 at org.sonatype.aether.connector.wagon.WagonRepositoryConnector
          $PutTask.run(WagonRepositoryConnector.java:837)
                 at
          org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:
          467)
                 at
          org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:
          274)
                 ... 14 more
          Caused by: org.apache.maven.wagon.TransferFailedException: Failed to
          transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar.
          Return code is: 401
                 at
          org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:
          256)
                 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:811)
                 ... 16 more
          [INFO] Deployment failed after 0,35 s
          Build step 'Déployer les artefacts dans le repository Maven' changed
          build result to FAILURE
          Skipping Cobertura coverage report as build was not SUCCESS or
          better ...
          Sending e-mails to: admin@my-company.com
          Finished: FAILURE

          For the moment I found a work around to this problem by deactivating deploy to repository post-task and specifying deploy instead of install in the maven goal configuration input

          Jean-Louis Jouannic added a comment - Since the last Jenkins upgrade to 1.442, all our maven jobs are failing during the post-build deploy to repository step. Nothing has changed in the maven configuration. The repositoy manager (nexus) seems OK as I can still deploy artifacts when running a mvn deploy on the same machine where Jenkins is running. Following is the "anonymized" stacktrace of a failing jenkins job : [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20 seconds [INFO] Finished at: Wed Dec 07 10:50:54 CET 2011 [INFO] Final Memory: 25M/61M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote maven settings from : /var/lib/ jenkins/.m2/settings.xml [INFO] Deployment in http://my-server/snapshots (id=my-company- snapshots,uniqueVersion=true) Déploiement de l'artefact principal my-artifact-0.0.2-SNAPSHOT.jar Downloading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/maven-metadata.xml Downloaded: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/maven-metadata.xml (789 B at 8.4 KB/sec) Uploading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar Uploading: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.pom ERROR: Failed to deploy artifacts: Could not transfer artifact com.my- company:my-artifact:jar:0.0.2-20111207.095055-6 from/to my-company- snapshots (http://my-server/snapshots): Failed to transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar. Return code is: 401 org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.my-company:my- artifact:jar:0.0.2-20111207.095055-6 from/to my-company-snapshots (http://my-server/snapshots): Failed to transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar. Return code is: 401 at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java: 141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java: 182) 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:692) at hudson.model.AbstractBuild $AbstractRunner.performAllBuildSteps(AbstractBuild.java:667) at hudson.maven.MavenModuleSetBuild $RunnerImpl.post2(MavenModuleSetBuild.java:1014) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java: 614) at hudson.model.Run.run(Run.java:1429) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481) at hudson.model.ResourceController.execute(ResourceController.java: 88) at hudson.model.Executor.run(Executor.java:238) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.my-company:my- artifact:jar:0.0.2-20111207.095055-6 from/to my-company-snapshots (http://my-server/snapshots): Failed to transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar. Return code is: 401 at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java: 280) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java: 211) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java: 443) 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.my-company:my-artifact:jar: 0.0.2-20111207.095055-6 from/to my-company-snapshots (http://my-server/ snapshots): Failed to transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar. Return code is: 401 at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $4.wrap(WagonRepositoryConnector.java:950) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $4.wrap(WagonRepositoryConnector.java:940) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $PutTask.run(WagonRepositoryConnector.java:837) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java: 467) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java: 274) ... 14 more Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://my-server/snapshots/com/my-company/my-artifact/0.0.2-SNAPSHOT/my-artifact-0.0.2-20111207.095055-6.jar. Return code is: 401 at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java: 256) 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:811) ... 16 more [INFO] Deployment failed after 0,35 s Build step 'Déployer les artefacts dans le repository Maven' changed build result to FAILURE Skipping Cobertura coverage report as build was not SUCCESS or better ... Sending e-mails to: admin@my-company.com Finished: FAILURE For the moment I found a work around to this problem by deactivating deploy to repository post-task and specifying deploy instead of install in the maven goal configuration input

          I also have a post-build deploy issue, with the same output as above.
          This works fine in my labo environment (Windows Seven), but it fails on our integration server (Linux RedHat 5.7), both with Jenkins 1.442 and the same Nexus repository instance.
          mvn deploy works fine either on command line and from Jenkins and is actually my workaround.

          Giorgio Anastopoulos added a comment - I also have a post-build deploy issue, with the same output as above. This works fine in my labo environment (Windows Seven), but it fails on our integration server (Linux RedHat 5.7), both with Jenkins 1.442 and the same Nexus repository instance. mvn deploy works fine either on command line and from Jenkins and is actually my workaround.

          Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli)
          on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact abc.zip.
          Return code is: 401

          I am getting this issue on Jenkins 1.450. while deploying artifact using a bat file.
          which is running from a pom.xml target using Jenkins.
          This works fine when I launch bat file, while fails when it launch through Jenkins.
          Please have a look on the issue.

          manvendra tomar added a comment - Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact abc.zip. Return code is: 401 I am getting this issue on Jenkins 1.450. while deploying artifact using a bat file. which is running from a pom.xml target using Jenkins. This works fine when I launch bat file, while fails when it launch through Jenkins. Please have a look on the issue.

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/jenkins/31b0ebee0303432683a7f805c901a6ecaa7ab26d
          Log:
          JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml
          @see hudson.maven.MavenUtil#createEmbedder

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/jenkins/31b0ebee0303432683a7f805c901a6ecaa7ab26d Log: JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml @see hudson.maven.MavenUtil#createEmbedder

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/jenkins/51d5220f6c19c4e7d5c35a07b62219472b2a7870
          Log:
          JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml
          @see hudson.maven.MavenUtil#createEmbedder

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/jenkins/51d5220f6c19c4e7d5c35a07b62219472b2a7870 Log: JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml @see hudson.maven.MavenUtil#createEmbedder

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1912
          JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml (Revision 31b0ebee0303432683a7f805c901a6ecaa7ab26d)

          Result = UNSTABLE
          Nicolas De Loof : 31b0ebee0303432683a7f805c901a6ecaa7ab26d
          Files :

          • maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1912 JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml (Revision 31b0ebee0303432683a7f805c901a6ecaa7ab26d) Result = UNSTABLE Nicolas De Loof : 31b0ebee0303432683a7f805c901a6ecaa7ab26d Files : maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1913
          JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml (Revision 51d5220f6c19c4e7d5c35a07b62219472b2a7870)

          Result = UNSTABLE
          Nicolas De Loof : 51d5220f6c19c4e7d5c35a07b62219472b2a7870
          Files :

          • maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1913 JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml (Revision 51d5220f6c19c4e7d5c35a07b62219472b2a7870) Result = UNSTABLE Nicolas De Loof : 51d5220f6c19c4e7d5c35a07b62219472b2a7870 Files : maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/maven-plugin/dd2fafb45e1d23c347674a7bdcd2f222b5a10113
          Log:
          [FIXED JENKINS-9084] Regression in jenkins .401 maven plugin - deploy to repository post-task
          logic to get remote settings.xml file, test in this order (as maven do)
          1. configured alternateSettings
          2. ~/.m2/settings.xml
          3. $M2_HOME/conf/settings.xml

          Originally-Committed-As: 0868af63972351c8fdf051fbc3673aa1be03e5a2

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/maven-plugin/dd2fafb45e1d23c347674a7bdcd2f222b5a10113 Log: [FIXED JENKINS-9084] Regression in jenkins .401 maven plugin - deploy to repository post-task logic to get remote settings.xml file, test in this order (as maven do) 1. configured alternateSettings 2. ~/.m2/settings.xml 3. $M2_HOME/conf/settings.xml Originally-Committed-As: 0868af63972351c8fdf051fbc3673aa1be03e5a2

          Code changed in jenkins
          User: Martijn Baay
          Path:
          src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/maven-plugin/ee3d323696a97069294bf92ba4c550d42ad40af1
          Log:
          Fixed JENKINS-9084: Made sure the correct slave is detected even when it's the Master

          Originally-Committed-As: fe9347435fd326cdd3bc2b7482d4b10922f1c160

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Martijn Baay Path: src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/maven-plugin/ee3d323696a97069294bf92ba4c550d42ad40af1 Log: Fixed JENKINS-9084 : Made sure the correct slave is detected even when it's the Master Originally-Committed-As: fe9347435fd326cdd3bc2b7482d4b10922f1c160

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/maven-plugin/d7527cbf0fd33c06e8ba206eef1de00ccaa1a2b7
          Log:
          JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml
          @see hudson.maven.MavenUtil#createEmbedder
          Originally-Committed-As: 51d5220f6c19c4e7d5c35a07b62219472b2a7870

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/maven-plugin/d7527cbf0fd33c06e8ba206eef1de00ccaa1a2b7 Log: JENKINS-9084 setting maven home is enough for global settings to be m.getHome()/conf/settings.xml @see hudson.maven.MavenUtil#createEmbedder Originally-Committed-As: 51d5220f6c19c4e7d5c35a07b62219472b2a7870

            olamy Olivier Lamy
            davidkarlsen2 David Karlsen
            Votes:
            13 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: