How to set the workspace root directory on Jenkins nodes?
continuous-integration, jenkins
Solution
We have to specify the following argument on startup of the Jenkins master node:
-Dhudson.model.Slave.workspaceRoot=D:/
To do so, find the `jenkins.xml` configuration file in `$JENKINS_HOME` and complete the `<arguments></arguments>` section.
Problem
By default, jobs on a Jenkins node will be stored in `[Remote FS root]\workspace\`. Currently, `[Remote FS root]` is set to `D:\`, so my jobs are in `D:\workspace\`. Due to the 255-characters limit on Windows, I need my job directories to be directly at the root of the drive. How to set the workspace root directory to `D:\`?