You question is best addressed to jenkins...@googlegroups.com.
jenkinsci-issues@ is used for automated JIRA messages.
That said I've answered your question below etc. and posted to -users
for others to comment as appropriate.
On 20/03/2012 11:39, Programie wrote:
> Hi,
>
> I'm using Jenkins with the Maven plugin. Jenkins is running in a Tomcat
> container.
>
> Tomcat is running using the wwwjenkins user. However the home directory of
> this user does not exist. The administrators of the server said me, they set
> it to an invalid directory to have an unique directory for each application.
> That may makes sense because multiple applications can run in the same user
> context.
>
> The problem: Maven tries to create the .m2 directory in the not existing
> home directory of the wwwjenkins user. How can I change the path used by
> Maven for the .m2 directory? I want to move it to JENKINS_HOME.
>
If you navigate to the "Manage Jenkins" page you can set the location of
the .m2 directory in the "Maven Project Configuration" section.
<yourjenkinsurl>/configure
You can set it to be "Local to executor" or "Local to workspace". I
suspect that you want "Local to workspace".
Regards
Richard
Hi,You question is best addressed to jenkinsci-users@googlegroups.com.
Jenkins did (does) use the local users repo when it is parsing the POM files (before the invocation of maven on the executor)
If you switch to the freestyle job this should work – but you will loose all of the goodness that comes with the Maven2 type job.
But – as you’re administrators expect this to be set per web-app in the app server why don’t you ask them to configure it for you on the app server?
/James
From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com]
On Behalf Of Michael Wieland
Sent: 20 March 2012 19:27
To: jenkins...@googlegroups.com
Subject: Re: Change path of .m2 directory if using maven-plugin
Hi,
I already tried that using the MAVEN_OPTS configuration field. But Maven still uses the old home directory.
On Tuesday, March 20, 2012 7:20:56 PM UTC+1, domi wrote:
add "-Duser.home=/oath/toNewDir" to the options
/Domi
On 20.03.2012, at 13:53, Michael Wieland wrote:
Hi,
thanks for your reply but that didn't solved the problem. :(
This option only changes the location of the local repository. The path to the .m2 directory does not change by using this option.
A build fails with this error message:
ERROR: Failed to create /not/existing/user/dir/.m2
I've looked at the source code of the maven-plugin and saw the path is hard coded to the property "user.home". Is there any way to set the user.home property in a Maven job?
Regards
Michael
On Tuesday, March 20, 2012 1:35:58 PM UTC+1, Richard Mortimer wrote:
Hi,
You question is best addressed to jenkins...@googlegroups.com.
jenkinsci-issues@ is used for automated JIRA messages.
That said I've answered your question below etc. and posted to -users
for others to comment as appropriate.
On 20/03/2012 11:39, Programie wrote:
> Hi,
>
> I'm using Jenkins with the Maven plugin. Jenkins is running in a Tomcat
> container.
>
> Tomcat is running using the wwwjenkins user. However the home directory of
> this user does not exist. The administrators of the server said me, they set
> it to an invalid directory to have an unique directory for each application.
> That may makes sense because multiple applications can run in the same user
> context.
>
> The problem: Maven tries to create the .m2 directory in the not existing
> home directory of the wwwjenkins user. How can I change the path used by
> Maven for the .m2 directory? I want to move it to JENKINS_HOME.
>
If you navigate to the "Manage Jenkins" page you can set the location of
the .m2 directory in the "Maven Project Configuration" section.
<yourjenkinsurl>/configure
You can set it to be "Local to executor" or "Local to workspace". I
suspect that you want "Local to workspace".
Regards
Richard
But – as you’re administrators expect this to be set per web-app in the app server why don’t you ask them to configure it for you on the app server?
From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Michael Wieland
Sent: 20 March 2012 19:27
To: jenkinsci-users@googlegroups.com
Subject: Re: Change path of .m2 directory if using maven-plugin
Hi,
I already tried that using the MAVEN_OPTS configuration field. But Maven still uses the old home directory.
On Tuesday, March 20, 2012 7:20:56 PM UTC+1, domi wrote:
add "-Duser.home=/oath/toNewDir" to the options
/Domi
On 20.03.2012, at 13:53, Michael Wieland wrote:
Hi,
thanks for your reply but that didn't solved the problem. :(
This option only changes the location of the local repository. The path to the .m2 directory does not change by using this option.
A build fails with this error message:
ERROR: Failed to create /not/existing/user/dir/.m2
I've looked at the source code of the maven-plugin and saw the path is hard coded to the property "user.home". Is there any way to set the user.home property in a Maven job?
Regards
Michael
On Tuesday, March 20, 2012 1:35:58 PM UTC+1, Richard Mortimer wrote:Hi,
You question is best addressed to jenkinsci-users@googlegroups.com.