jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-28718] withTool

Abierto
#393 13 comentarios 0 reacciones 0 asignados Ver en GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Lenguaje dominante
Java
Estrellas
73
Forks
129
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by reading the referenced Maven.java code around line 502 and the workflow-basic-steps-plugin entry points for steps that establish environment variables. Implement the requested withTool('Maven 3.2.2') block behavior so the tool environment is available inside the block, then verify that the example no longer needs a manual withEnv PATH setup.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
devtools
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.