1

I just want to change the .m2 path of a jenkins project in maven. Everytime when I build the project the .m2 folder is in c:\ and empty! There's no settings.xml or something...

The .m2 path of eclipse is in user.home (that's okay).

But how can I change the path of the .m2 folder in jenkins?

Thank you guys ;-)

  • possible duplicate of [How to manage maven settings.xml on a shared jenkins server?](http://stackoverflow.com/questions/16685515/how-to-manage-maven-settings-xml-on-a-shared-jenkins-server) – Mark O'Connor Feb 05 '14 at 21:48

1 Answers1

3

In the project configuration page of Jenkin, under the tab Build, select Invoke Maven and click on Advanced. There is a check box Use private Maven repository. If this is selected, Jenkins will tell Maven to use $WORKSPACE/.repository as the local Maven repository. Click on the help topic in Jenkin itself. It will give a clear idea.

If you need to invoke maven out side this plugin, you can pass

-Dmaven.repo.local=/some/path/.maven/repo

Dipu H
  • 2,372
  • 15
  • 24