jenkinsci / jenkinsci/workflow-basic-steps-plugin
[JENKINS-48733] withEnv not setting PATH environment variable
- Dominant language
- Java
- Stars
- 73
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
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
---
Originally reported by bkeyser_dgi, imported from: withEnv not setting PATH environment variable
Raw content of original issue
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 foundThis exact script works with Jenkins 2.73.1 and the Pipeline Model API 1.2.5 plugin
environment
```
Jenkins 2.89.2
Pipeline Model API 1.2.5
```
Contributor guide
Assessment
This issue has not been assessed yet.