-
New Feature
-
Resolution: Fixed
-
Major
-
None
Using
env.PATH="${tool 'Maven'}/bin:${env.PATH}"
works fine if you are only using only slave, or even if you have several but are using them serially. But it would not work when running things in parallel on several slaves (with different installation locations).
For that case it would be better to write something like
node { env("PATH=${tool 'Maven'}/bin:${env.PATH}") { // ... sh 'mvn install' // ... } }
where the block step would temporarily override one (or more?) environment variables, but only in that thread. (These would presumably not be exposed via the REST API.)
The workaround is to define the environment variable in each sh or similar step, or do without it (in this example by giving an absolute executable name).
- depends on
-
JENKINS-27901 Standard form control for string collections
- Open
- is duplicated by
-
JENKINS-27105 workflow-plugin: 'env' before 'sh' will hang 'sh'
- Resolved
- is related to
-
JENKINS-27631 Do not even temporarily save secrets in Workflow build record
- Resolved
-
JENKINS-27145 Advertise available environment variables
- Resolved
- links to