I have an issue running a jenkins job in slave using maven (Maven home doesn´t exist)

我与影子孤独终老i 提交于 2019-12-22 10:33:20

问题


I am experiencing an issue running Jenkins job using slaves. The job is a Maven job, that updates code from svn and then build and run tests, this project runs well in both master and slave as an standalone project. The issue is when Master launch this project in the slave, in that case I see:

...
Svn Update OK
Error: Maven Home c:\maven doesn´t exist

Both servers have maven on that dir, and both servers are able to run the build without master/slave setup.

Can you see what is happening? Any clues?

Thank you very much,

Santiago


回答1:


Finally,I solve this problem. The reason of "Error: Maven Home c:\maven doesn´t exist" is that your slave node use the master`s maven setting . If the slave want to use its own setting , it has to override that. Override the settings as follows: System Management -> Node Management -> your slave setting -> Node Properties -> check the Tools Locations -> Add , then set the slave maven option,alias select "maven",directory write with the slave maven directory. you can try it.




回答2:


You need to invoke your top-level maven targets and set the goals and path to pom, for instance: goals: clean install Pom: /home/merbel/sth/pom.xml



来源:https://stackoverflow.com/questions/14201855/i-have-an-issue-running-a-jenkins-job-in-slave-using-maven-maven-home-doesn%c2%b4t-e

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