Jenkins – Unable to set Workspace Root Directory on Jenkins master on Windows

Jenkins

I need to set my workspace root directory to another location to save space on the C drive. I am able to change the configuration in the 'workspace root directory' field in Manage Jenkins / Configuration but this is not reflected in my builds.

I've tried restarting the windows service, rebooting etc. I've also tried as previous posts suggested building from the 'workspace' page for affected projects to no avail.

I've tried setting the workspace root directory to:
D:/Jenkins/workspace/
D:\Jenkins\workspace
D:/Jenkins/workspace/${ITEM_FULLNAME}

However, builds are still trying to use the default workspace as seen by the console output:
"Started by user anonymous
Building on master in workspace C:\Program Files (x86)\Jenkins\workspace\xxxx\xxxxx"

I have tried clearing workspaces of failing jobs and building from the 'workspace' page for those jobs – this didn't help.

Best Answer

I found the issue. There was a custom workspace set for each job in the dev server that I inherited. The custom workspace was a relative path (\jobname...) but it was appending the relative path to the 'Home Directory' as opposed to the 'Workspace Root Directory'. I had assumed wrongly that the custom workspace path would be relative to the workspace root directory.

Related Topic