-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Pipeline Maven Integration Plugin 3.6.7
Using Jenkinsfile with
withMaven(mavenLocalRepo: '${user.home}/.m2/$EXECUTOR_NUMBER/repository')
resolves the local repository path to
-Dmaven.repo.local=/home/jenkins/workspace/somerepository/${user.home}/.m2/2/repository: bad substitution
so user.home does not get resolved. This is fine if not possible now. But also using
withMaven(mavenLocalRepo: '~/.m2/$EXECUTOR_NUMBER/repository')
resolves the local repository path to
-Dmaven.repo.local=/home/jenkins/workspace/somerepository/~/.m2/2/repository
Using
withMaven(mavenLocalRepo: '$WORKSPACE/../../.m2/$EXECUTOR_NUMBER/repository')
can be used to escape from a single non-permanent workspace to use a common local repository, but this is not ideal.
Concerned code seems to be here:
https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.6.7/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L662
The related commit is here: https://github.com/jenkinsci/pipeline-maven-plugin/commit/496eb784e2e9a0fd9e463922f6001848c2d5eda6