jenkinsci / jenkinsci/workflow-basic-steps-plugin
[JENKINS-28718] withTool
Open
component:workflow-basic-steps-plugin
imported-jira-issue
priority:major
resolution:unresolved
- Dominant language
- Java
- Stars
- 73
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Rather than
withEnv(["PATH=${tool 'Maven 3.2.2'}/bin:${env.PATH}"]) {sh 'mvn package'}
you should be able to say
withTool('Maven 3.2.2') {sh 'mvn package'}
where this code builds the environment variables within the block.
---
Originally reported by
jglick, imported from: withTool
jglick
Raw content of original issue
Rather than
withEnv(["PATH=${tool 'Maven 3.2.2'}/bin:${env.PATH}"]) {sh 'mvn package'}you should be able to say
withTool('Maven 3.2.2') {sh 'mvn package'}where this code builds the environment variables within the block.
Contributor guide
Assessment
This issue has not been assessed yet.