Search code examples
eclipsemavenjenkinstestngworkspace

Why does Jenkins change my workspace path?


i have installed Jenkins on Windows 10 and each time i try to execute a maven project or just try to execute mvn clean test (command line), Jenkins decides that my new workspace should be: C:\Windows\system32\config\systemprofile\eclipse-workspace\ while my project is in C:\Users\username\eclipse-workspace. Jenkins starts in the directory C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\projectName and even if i run a cd command i will have this problem:

The driver executable must exist: C:\Windows\system32\config\systemprofile\eclipse-workspace\projectname\drivers\chromedriver\chromedriver.exe

My chrome driver is not there obviously but it's in C:\Users\userName\eclipse-workspace\projectName\drivers\chromedriver.

It looks like than Jenkins changes my user.home. I went to config file and set:

<workspaceDir>C:\Users\userName\eclipse-workspace</workspaceDir>

but it's still looking for the driver in C:\Windows\system32\config\systemprofile\eclipse-workspace\projectname\drivers\chromedriver\chromedriver.exe

This part: C:\Windows\system32\config\systemprofile\ is obtained using in Java System.getProperty("user.home"). Running it with Jenkins seems to modify it.

Why is it looking for my driver there? Why can't it just stick to my workspace folder? How can i solve this?

Thank you


Solution

  • I think i solved it. I was running under Local System Account https://jenkins-le-guide-complet.github.io/html/sect-windows-service.html#fig-hudson-windows-service-config

    I had edit the service as shown in the link.