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

Docker container does not read maven settings.xml after updating

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • docker-workflow-plugin
    • None
    • Jenkins ver. 2.87, Docker Pipeline plugin 1.14

      After updating the Docker Pipeline plugin from 1.13 to 1.14 our builds started failing on the deploy phase, with an error that they cannot authenticate with the repository:

      ** 11:35:25 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project [project]: Failed to deploy artifacts: Could not transfer artifact [artifact] from/to [snapshot repository]

      The credentials for that repository are in the maven settings.xml, which is defined under the 'configfiles' settings provided by the Configuration File Provider plugin. Here's a trimmed-down view of the relevant section from the Jenkinsfile library that all jobs call into:

      ...
      def mavenImage = docker.image([jenkins image])
      mavenImage.pull()
      mavenImage.inside('--net=host -v /var/run/docker.sock:/var/run/docker.sock:rw -v /home/jenkins/.m2/repository:/home/jenkins/.m2/repository:rw') {
          withMaven(maven: MAVEN_INSTALLATION, mavenSettingsConfig: MAVEN_SETTINGS, options: getMavenOpts()) {
              sh 'mvn clean deploy ...'
              ...
          }
      }
      ...

       

      Seems like the settings.xml defined in the Configuration File Provider plugin might not be honored the same way it was before updating. Is there something that we should do to update our Jenkinsfiles/library to be compatible with the new plugin?

      If you need any more information, let me know. Rolling the plugin back to 1.13 did get the builds running again for now, but ideally I would like to stay up-to-date with the latest.

            Unassigned Unassigned
            nv035674 Nathan Vahrenberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: