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

          David Karlsen created issue -

          Olivier Lamy added a comment -

          the settings.xml is where in the master or in the node ?
          BTW I have fixed some stuff recently regarding this.
          Can you try with a jenkins build from master sources ?
          Or using this one : http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/lastSuccessfulBuild/artifact/war/target/jenkins.war

          Olivier Lamy added a comment - the settings.xml is where in the master or in the node ? BTW I have fixed some stuff recently regarding this. Can you try with a jenkins build from master sources ? Or using this one : http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/lastSuccessfulBuild/artifact/war/target/jenkins.war

          David Karlsen added a comment - - edited

          settings.xml is in the same location as before the upgrade (e.g. when this worked just fine) - and that is in MAVEN_HOME/conf/settings.xml.
          Last time I tried updating jenkins.war it broke kind of badly - and due to our operations situation it is not very easy and swift - so a little reluctant - but i can see what's possible and not.

          David Karlsen added a comment - - edited settings.xml is in the same location as before the upgrade (e.g. when this worked just fine) - and that is in MAVEN_HOME/conf/settings.xml. Last time I tried updating jenkins.war it broke kind of badly - and due to our operations situation it is not very easy and swift - so a little reluctant - but i can see what's possible and not.

          Olivier Lamy added a comment -

          do you have settings file with correct karma for deploying in ~/.m2/settings.xml ?

          Olivier Lamy added a comment - do you have settings file with correct karma for deploying in ~/.m2/settings.xml ?

          David Karlsen added a comment -

          No - I have them under the MAVEN_HOME/conf (overwriting the one in the distro).
          Don't want to have them in maven repos as I usually use "private maven repository" option.

          David Karlsen added a comment - No - I have them under the MAVEN_HOME/conf (overwriting the one in the distro). Don't want to have them in maven repos as I usually use "private maven repository" option.

          Olivier Lamy added a comment -

          ok I see. So I have to change the logic I have added recently to fix the use private maven repository option.

          Olivier Lamy added a comment - ok I see. So I have to change the logic I have added recently to fix the use private maven repository option.

          Olivier Lamy added a comment -

          So as discussed a workaround you can put you settings.xml in ~/.m2 of your nodes.
          Note for myself : change the logic here https://github.com/jenkinsci/jenkins/blob/master/maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java#L185 and if not remote : ~/.m2/settings.xml use remote : $M2_HOME/conf/settings.xml ($M2_HOME is remote path for maven installation used)

          Olivier Lamy added a comment - So as discussed a workaround you can put you settings.xml in ~/.m2 of your nodes. Note for myself : change the logic here https://github.com/jenkinsci/jenkins/blob/master/maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java#L185 and if not remote : ~/.m2/settings.xml use remote : $M2_HOME/conf/settings.xml ($M2_HOME is remote path for maven installation used)

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/jenkins/0868af63972351c8fdf051fbc3673aa1be03e5a2
          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

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/jenkins/0868af63972351c8fdf051fbc3673aa1be03e5a2 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
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #612
          [FIXED JENKINS-9084] Regression in jenkins .401 maven plugin - deploy to repository post-task

          Olivier Lamy : 0868af63972351c8fdf051fbc3673aa1be03e5a2
          Files :

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

          dogfood added a comment - Integrated in jenkins_main_trunk #612 [FIXED JENKINS-9084] Regression in jenkins .401 maven plugin - deploy to repository post-task Olivier Lamy : 0868af63972351c8fdf051fbc3673aa1be03e5a2 Files : maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java

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

              Created:
              Updated:
              Resolved: