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

withEnv not setting PATH environment variable

XMLWordPrintable

      With a pipeline definition similar to

      pipeline {
          agent {
              docker {
                  image 'registry/org/buildagent'
              }
          }
      
          tools {
              jdk 'jdk-1.7.0_131'
              maven 'maven-3.5.0'
          }
      
          stages {
              stage ('Build') {
                  steps {
                      sh('mvn deploy')
                  }
              }
          }
      }

      The following message is generated

      + mvn deploy
      /workspace/project@tmp/durable-d723cc26/script.sh: line 2: mvn: command not found

      This exact script works with Jenkins 2.73.1 and the Pipeline Model API 1.2.5 plugin

            Unassigned Unassigned
            bkeyser_dgi Brian Keyser
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: