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

Unable to use withMaven() step inside docker container for old versions of Docker

XMLWordPrintable

      I'm not able to use withMaven step inside docker container.

      [Pipeline] withMaven
      $ docker exec ffff env printenv MAVEN_HOME
      $ docker exec ffff env printenv M2_HOME
      $ docker exec ffff env /bin/sh -c "which mvn"
      Using maven exec: /opt/apache-maven-3.3.9/bin/mvn
      Using global settings config with name MavenGlobal
      Replacing all maven server entries not found in credentials list is false
      [Pipeline] {
      [Pipeline] sh
      
      [test-XXX] Running shell script
      nohup: failed to run command `sh': No such file or directory
      
      [Pipeline] }
      [Pipeline] // withMaven

      My Jenkinsfile pipeline:

      node('docker') {
          stage('Checkout') {
              checkout scm
          }
          buildInDocker('linux') {
              stage('Maven') {
                  withMaven(globalMavenSettingsConfig: '11111111-2222-3333-4444-555555555555') {
                          sh 'mvn clean test'
                  }
              }
          }
      }

      It looks like PATH env gets overwritten.

        1. 20170915-v.2.78-JENKINS-40484-CONSOLE-LOG-NOK.txt
          4 kB
          Nuno Costa
        2. 20170915-v.2.78-JENKINS-40484-CONSOLE-LOG-OK.txt
          546 kB
          Nuno Costa
        3. 20170915-v.2.78-JENKINS-40484-JENKINS-LOG-NOK.txt
          4 kB
          Nuno Costa
        4. 20170915-v.2.78-JENKINS-40484-JENKINS-LOG-OK.txt
          4 kB
          Nuno Costa
        5. Capture.PNG
          21 kB
          dan tran

            Unassigned Unassigned
            testuser7 Test User
            Votes:
            13 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated: