[JIRA] (JENKINS-56232) Maven Local Repository is always seen as relative when it should be absolute

2 views
Skip to first unread message

lasse.k.lindqvist@gmail.com (JIRA)

unread,
Feb 21, 2019, 5:24:03 AM2/21/19
to jenkinsc...@googlegroups.com
Lasse Lindqvist created an issue
 
Jenkins / Bug JENKINS-56232
Maven Local Repository is always seen as relative when it should be absolute
Issue Type: Bug Bug
Assignee: Alvaro Lobato
Components: pipeline-maven-plugin
Created: 2019-02-21 10:23
Environment: Pipeline Maven Integration Plugin 3.6.7
Priority: Minor Minor
Reporter: Lasse Lindqvist

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: bad substitution

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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

lasse.k.lindqvist@gmail.com (JIRA)

unread,
Feb 21, 2019, 5:25:03 AM2/21/19
to jenkinsc...@googlegroups.com
Lasse Lindqvist updated an issue
Change By: Lasse Lindqvist
Using Jenkinsfile with

withMaven(mavenLocalRepo: '${user.home}/.m2/$EXECUTOR_NUMBER/repository')

resolves the local repository path to
{code:java}

-Dmaven.repo.local=/home/jenkins/workspace/somerepository/${user.home}/.m2/2/repository: bad substitution
{code}

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
{code:java}
-Dmaven.repo.local=/home/jenkins/workspace/somerepository/~/.m2/2/repository
: bad substitution
{code}


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

cleclerc@cloudbees.com (JIRA)

unread,
Feb 22, 2019, 5:59:03 AM2/22/19
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Apr 22, 2019, 5:56:02 PM4/22/19
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Apr 22, 2019, 5:56:02 PM4/22/19
to jenkinsc...@googlegroups.com
Cyrille Le Clerc started work on Bug JENKINS-56232
 
Change By: Cyrille Le Clerc
Status: Open In Progress

lasse.k.lindqvist@gmail.com (JIRA)

unread,
Apr 23, 2019, 3:34:02 AM4/23/19
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Apr 23, 2019, 7:41:02 AM4/23/19
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
May 29, 2019, 10:12:02 AM5/29/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages