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

Maven mirrors not used when project uses Maven 2.2

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None
    • Ubuntu Lucid

      After upgrading from 1.391 to 1.392, Maven 2.2.1 builds fail when requiring that new artifacts be downloaded from a local Maven repository proxy (Nexus). Even though Maven is configured to use the proxy as a mirror for all repositories, artifacts are attempted to be downloaded from the actual repositories. Downgrading to 1.391 fixes the issue.

      Settings.xml
      <mirrors/>
          <mirror>
              <id>nexus</id>
              <mirrorOf>*</mirrorOf>
              <url>http://my.internal.nexus/content/groups/public</url>
          </mirror>
      <mirrors>
      <profiles>
          <profile>
              <repositories>
                  <repository>
                      <id>other-repo</id>
                      <url>http://www.external.url.com/m2</url>
                      <releases>
                          <enabled>true</enabled>
                      </releases>
                      <snapshots>
                          <enabled>true</enabled>
                      </snapshots>
                  </repository>
              </repositories>
              <pluginRepositories>
                  <pluginRepository>
                      <id>other-repo</id>
                      <url>http://www.external.url.com/m2</url>
                      <releases>
                          <enabled>true</enabled>
                      </releases>
                      <snapshots>
                          <enabled>true</enabled>
                      </snapshots>
                  </pluginRepository>
              </pluginRepositories>
          </profile>
      </profiles>
      

      Logs report a 407 response when trying to retrieve the artifact from http://www.external.url.com/m2/org/new/artifact/1.1.0-SNAPSHOT/artifact-1.1.0-SNAPSHOT.jar.

          [JENKINS-8387] Maven mirrors not used when project uses Maven 2.2

          Olivier Lamy added a comment -

          does your mirror need authz ?
          If yes you have probably a server section in your ~/.m2/settings.xml, is it with encrypted password or plain text ?
          Then do you use a particular configuration for the settings path : s,-settings ?
          To be sure this occurs during the pom parsing phase ?
          Thanks

          Olivier Lamy added a comment - does your mirror need authz ? If yes you have probably a server section in your ~/.m2/settings.xml, is it with encrypted password or plain text ? Then do you use a particular configuration for the settings path : s, -settings ? To be sure this occurs during the pom parsing phase ? Thanks

          dan_yell added a comment -

          The mirror doesn't require authentication/authorisation to retrieve artifacts, but needs authentication to deploy them. Settings.xml contains a server section for the deployment url only, containing a plain text password. Settings.xml is in the default location (~/.m2/settings.xml). I don't think the error occurs during the pom parsing phase, given that it appears to be the result of a failed attempt to download an artifact. I don't have the log file, sorry.

          dan_yell added a comment - The mirror doesn't require authentication/authorisation to retrieve artifacts, but needs authentication to deploy them. Settings.xml contains a server section for the deployment url only, containing a plain text password. Settings.xml is in the default location ( ~/.m2/settings.xml ). I don't think the error occurs during the pom parsing phase, given that it appears to be the result of a failed attempt to download an artifact. I don't have the log file, sorry.

          Olivier Lamy added a comment -

          I need to know when this happened during the build.
          Any logs sure ? (you can send me in private email if you prefer)

          Thanks.

          Olivier Lamy added a comment - I need to know when this happened during the build. Any logs sure ? (you can send me in private email if you prefer) Thanks.

          dan_yell added a comment -

          I don't have access to the logs at the moment, but I can probably send them to you in a couple of days when I'm back at work.

          dan_yell added a comment - I don't have access to the logs at the moment, but I can probably send them to you in a couple of days when I'm back at work.

          Olivier Lamy added a comment -

          no problem.
          I think I have found the issue. I will push a SNAPSHOT version somewhere for you testing.

          Olivier Lamy added a comment - no problem. I think I have found the issue. I will push a SNAPSHOT version somewhere for you testing.

          Olivier Lamy added a comment -

          Fixed.
          you can try with this build :
          wget http://people.apache.org/~olamy/hudson/main-maven3-support/hudson.war
          Thanks.

          Olivier Lamy added a comment - Fixed. you can try with this build : wget http://people.apache.org/~olamy/hudson/main-maven3-support/hudson.war Thanks.

          Code changed in hudson
          User: Olivier Lamy
          Path:
          maven-plugin/pom.xml
          http://hudson-labs.org/commit/core/f9f90ba57a9c18afe8eb21d54a52d472bc794a5f
          Log:
          JENKINS-8387 Maven mirrors not used when project uses Maven 2.2
          upgrade hudson-maven-embedder to last SNAPSHOT

          SCM/JIRA link daemon added a comment - Code changed in hudson User: Olivier Lamy Path: maven-plugin/pom.xml http://hudson-labs.org/commit/core/f9f90ba57a9c18afe8eb21d54a52d472bc794a5f Log: JENKINS-8387 Maven mirrors not used when project uses Maven 2.2 upgrade hudson-maven-embedder to last SNAPSHOT

          Code changed in hudson
          User: Olivier Lamy
          Path:
          changelog.html
          http://hudson-labs.org/commit/core/37df755be1cd01cb22ba2ad8826da71f1c000f17
          Log:
          add changelog for issue 8387 http://issues.jenkins-ci.org/browse/JENKINS-8387

          SCM/JIRA link daemon added a comment - Code changed in hudson User: Olivier Lamy Path: changelog.html http://hudson-labs.org/commit/core/37df755be1cd01cb22ba2ad8826da71f1c000f17 Log: add changelog for issue 8387 http://issues.jenkins-ci.org/browse/JENKINS-8387

            olamy Olivier Lamy
            dan_yell dan_yell
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: