Jenkins job in slave using maven - Maven home doesn't exist
Asked Answered
C

3

3

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 a 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.

Capwell answered 7/1, 2013 at 18:30 Comment(3)
check for spaces somewhere in the path C:\maven ... ??Nim
Is Jenkins running as a slave service on your slave machine? Does it have correct access/permissions to the C:\maven folder?Clower
I could solve the problem, unfortunately It was a distraction I made, I ran the slave start command on another vm with similar ip address (One ended with 100 and the other with 110) Yes... shame on me!Capwell
S
6

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.

Sidecar answered 4/9, 2013 at 9:3 Comment(0)
C
0

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

Candlewick answered 17/12, 2013 at 17:7 Comment(0)
F
0

Finally i solve this issue, it was very simple just we need to check the global configuration that in maven part we have given correct path or not as a maven home.

for example: in global tools configuration..>come down in maven home part

maven Name: M2_HOME MAVEN_HOME: /opt/maven

like this we need to give correct path where maven was untar so after checking this try once.....

in most cases it works succesfully.....

Freakish answered 5/12, 2022 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.