Configure Jenkins for different user.home
I found another workaroud.
- Go to the Manage Jenkins > Configure System
- Navigate to the Global Properties
- Make the Checkbox Environment variables active
- Name field pop up the user.home
- value is your desired path
- Click Apply, Save and Restart Jenkins
This overrides that path.
I exactly had the same problem. You cannot just add an environment variable to change the path. You'll need to change the jenkins user's home directory itself.
In a linux/unix based system run the following command on your terminal.
login as a root user or use sudo in front of the commands if you're not running it as root user,
1) Move the Jenkins installation directory your desired location.
mv /var/lib/jenkins /path/to/your/location
2) Change the Jenkins users home directory.
usermod -d /path/to/your/location jenkins
Now restart jenkins. You should see the user.home and HOME variable set to the new location.