Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Hudson master on linux & multipule slaves

      Description

      Description:
      Using promotion plug-in to (re)deploy artifacts as a post build promotion returns 401 (from Nexus Maven repository).

      Steps to reproduce:
      1. Create a maven2 job build, with clean install goals
      2. Add a promotion which will redeploy artifacts upon a successful build (doesn't matter if it's manual or automatic)
      3. run the promotion
      result:
      Return code is: 401
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94)
      at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119)
      at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79)
      at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:109)
      at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:124)
      at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:103)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)

      Now if you perform "redploy artifacts" from link (in build context) - deploy is successful and running the promotion manually after executing a successful "redeploy artifacts" the promotion succeeds - it seems as if the maven settings isn't being read whilst using the promotion

      => This is a major setback all our release mechanism is based on this deploy promotion.

      Also see: http://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin?focusedCommentId=45482210#comment-45482210

        Issue Links

          Activity

          Hide
          mturra mturra added a comment -

          I have the same issue.
          I put server credential into settings.xml via "Config File Provider Plugin" and "Default global settings provider" configuration.
          But it didn't work.

          I configured the user credential in the "Credential" configuration using a domain with specification "Maven ServerId" and another with specification "Hostname", but both of these configuration failed.

          I get this stack trace:
          Return code is: 401, ReasonPhrase: Unauthorized.
          at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
          at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:193)
          at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:176)

          Where the "Deploy maven artifacts to Maven repository" action is supposed to read the credential to upload artifact to the repository?

          Show
          mturra mturra added a comment - I have the same issue. I put server credential into settings.xml via "Config File Provider Plugin" and "Default global settings provider" configuration. But it didn't work. I configured the user credential in the "Credential" configuration using a domain with specification "Maven ServerId" and another with specification "Hostname", but both of these configuration failed. I get this stack trace: Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:193) at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:176) Where the "Deploy maven artifacts to Maven repository" action is supposed to read the credential to upload artifact to the repository?
          Hide
          aheritier Arnaud Héritier added a comment -

          Hi guys,

          Do you have the same issue if you use the redeploy maven binaries from a the maven job without using the promotion plugin ? Did you test it ?
          You have to know that the Maven Redeploy Publisher is called from Master and not from the slave where the build was done. It is working from archived artifacts and thus the issue might be that on master you don't have the required maven settings to do the upload.

          I will try to test and diagnose more on my side but all feedbacks you could provide may help

          cheers

          Show
          aheritier Arnaud Héritier added a comment - Hi guys, Do you have the same issue if you use the redeploy maven binaries from a the maven job without using the promotion plugin ? Did you test it ? You have to know that the Maven Redeploy Publisher is called from Master and not from the slave where the build was done. It is working from archived artifacts and thus the issue might be that on master you don't have the required maven settings to do the upload. I will try to test and diagnose more on my side but all feedbacks you could provide may help cheers
          Hide
          aheritier Arnaud Héritier added a comment -

          Hi, I did more tests and confirm the bug. The RedeployPublisher doesn't look at the settings of the parent job when it is inside a promotion sub-job.

          Show
          aheritier Arnaud Héritier added a comment - Hi, I did more tests and confirm the bug. The RedeployPublisher doesn't look at the settings of the parent job when it is inside a promotion sub-job.
          Hide
          aheritier Arnaud Héritier added a comment - - edited

          This pull request is solving the incompatibility of the publisher when used inside a promotion

          Show
          aheritier Arnaud Héritier added a comment - - edited This pull request is solving the incompatibility of the publisher when used inside a promotion
          Hide
          aheritier Arnaud Héritier added a comment -
          Show
          aheritier Arnaud Héritier added a comment - A snapshot including the fix can be downloaded from : https://jenkins.ci.cloudbees.com/job/plugins/job/maven-plugin/170/org.jenkins-ci.main$maven-plugin/
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Arnaud Héritier
          Path:
          pom.xml
          src/test/java/hudson/maven/RedeployPublisherTest.java
          src/test/resources/hudson/maven/settings.xml
          src/test/resources/hudson/maven/simple-pom.xml
          http://jenkins-ci.org/commit/maven-plugin/bd76d488434597baeae70697aa11cb15f744aee4
          Log:
          JENKINS-7010: Maven settings configured at Maven job level aren't used inside the promotion step - Add test case to demonstrate the issue

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Héritier Path: pom.xml src/test/java/hudson/maven/RedeployPublisherTest.java src/test/resources/hudson/maven/settings.xml src/test/resources/hudson/maven/simple-pom.xml http://jenkins-ci.org/commit/maven-plugin/bd76d488434597baeae70697aa11cb15f744aee4 Log: JENKINS-7010 : Maven settings configured at Maven job level aren't used inside the promotion step - Add test case to demonstrate the issue
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Arnaud Héritier
          Path:
          src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/maven-plugin/a2bcad0aab1f347aded7939f90a39e59b4314026
          Log:
          JENKINS-7010: Maven settings configured at Maven job level aren't used inside the promotion step - Fix issue

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Héritier Path: src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/maven-plugin/a2bcad0aab1f347aded7939f90a39e59b4314026 Log: JENKINS-7010 : Maven settings configured at Maven job level aren't used inside the promotion step - Fix issue
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          pom.xml
          src/main/java/hudson/maven/RedeployPublisher.java
          src/test/java/hudson/maven/RedeployPublisherTest.java
          src/test/resources/hudson/maven/settings.xml
          src/test/resources/hudson/maven/simple-pom.xml
          http://jenkins-ci.org/commit/maven-plugin/e32ebce36791e222dd77673f3b780515cd692778
          Log:
          Merge pull request #54 from aheritier/fix/JENKINS-7010

          JENKINS-7010: Maven settings configured at Maven job level aren't used inside the promotion step

          Compare: https://github.com/jenkinsci/maven-plugin/compare/59eb555111f6...e32ebce36791

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: pom.xml src/main/java/hudson/maven/RedeployPublisher.java src/test/java/hudson/maven/RedeployPublisherTest.java src/test/resources/hudson/maven/settings.xml src/test/resources/hudson/maven/simple-pom.xml http://jenkins-ci.org/commit/maven-plugin/e32ebce36791e222dd77673f3b780515cd692778 Log: Merge pull request #54 from aheritier/fix/ JENKINS-7010 JENKINS-7010 : Maven settings configured at Maven job level aren't used inside the promotion step Compare: https://github.com/jenkinsci/maven-plugin/compare/59eb555111f6...e32ebce36791

            People

            • Assignee:
              aheritier Arnaud Héritier
              Reporter:
              hagzag hagzag
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: