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

withMaven doesn't copy settings.xml to Docker container

XMLWordPrintable

      I've been trying to figure this for a while now and don't seem to understand what's wrong nor why. 

      We're trying to build a java project in a Docker container using `withMaven` and a configuration saved in `Manage Jenkins -> Managed Files -> Maven settings.xml`. This configuration has been working fine for months but yesterday it just stopped. Our builds are depending on artifacts which are deployed to a local repository and therefore all of our builds are now failing. 

      I've tried logging into the docker container while it's running and checking `~/.m2/settings.xml` but the file is not there. Not sure why it's not being copied, but it's not a permission issue as far as I can tell. 

      Our pipeline is quite trivial:

      pipeline {
          agent {
              docker {
                  image 'opensuse-custom-image-with-jdk-and-maven:latest'
              }
          }
          options {
              timeout(time: 2, unit: 'HOURS')
              disableConcurrentBuilds()
              skipDefaultCheckout()
          }
          stages {
              stage('Building...')
              {
                  steps {
                      withMaven(maven: 'maven-3.3.9', mavenSettingsConfig: 'redacted')
                      { 
                          sh "mvn -U clean install -Dmaven.test.failure.ignore=true"
                      }
                  }
              }
          }
      }
       

            cleclerc Cyrille Le Clerc
            stodorov Steve Todorov
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: