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

withEnv not setting PATH environment variable

      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

          [JENKINS-48733] withEnv not setting PATH environment variable

          Brian Keyser created issue -
          Andrew Bayer made changes -
          Component/s New: workflow-basic-steps-plugin [ 21712 ]
          Component/s Original: pipeline-model-definition-plugin [ 21706 ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]
          Andrew Bayer made changes -
          Summary Original: tools directive not setting PATH environment variable New: withEnv not setting PATH environment variable
          Andrew Bayer made changes -
          Labels Original: pipeline New: pipeline triaged-2018-11
          Yoerg made changes -
          Component/s New: core [ 15593 ]
          Yoerg made changes -
          Component/s Original: core [ 15593 ]

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

              Created:
              Updated: