Jenkins.workspaceDir is supposed to default to $JENKINS_HOME/workspace/ on new installations: the "modern" location, consistent with that of slaves. But if you do not save the Jenkins global configuration during the first startup, on the next startup $JENKINS_HOME/jobs/ exists yet $JENKINS_HOME/config.xml does not, so the "compatibility" code kicks in and the old location is used!
Just setting this field to the new value in the instance initializer probably does not suffice, since installations upgraded from before the introduction of this field would be incorrectly switched to the new value.
Probably suffices to adjust the check to also check for the existence of $JENKINS_HOME/config.xml, since most old installations would have saved this file at least once.
- is blocking
-
JENKINS-8446 'builds' directory in a separate location?
- Closed
- is duplicated by
-
JENKINS-39670 Jenkins changes workspace layout on 2nd startup
- Resolved
- is related to
-
JENKINS-60969 @libs pseudo-workspace collision due to branch name truncation
- In Progress
- relates to
-
JENKINS-38837 Mutibranch project plugin does not respect "Workspace Root Directory" global configuration
- Resolved
-
JENKINS-54654 A recent update breaks builds by escaping slashes to percent signs in workspace paths
- Resolved
-
JENKINS-50164 'Build Record Root Directory' is a UI option but is unsafe to change while Jenkins is running
- Closed
-
JENKINS-53284 Changing default layout for workspace and builds should not be a warning for first time startup
- Fixed but Unreleased