jenkins on windows | change .m2 path

时光总嘲笑我的痴心妄想 提交于 2019-12-11 19:45:15

问题


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 ;-)


回答1:


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



来源:https://stackoverflow.com/questions/21577409/jenkins-on-windows-change-m2-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!