jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-28718] withTool

Aperta
#393 13 commenti 0 reazioni 0 assegnatari Vedi su GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Lingua principale
Java
Stelle
73
Fork
129
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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


  • assignee: jglick
  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • label(s): followup, tools
  • resolution: Unresolved
  • votes: 8
  • watchers: 17
  • imported: 20251215-220547

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.