Steps to reproduce:
1. java -jar jenkins.war with no explicitly defined JENKINS_HOME has the default $HOME/.jenkins (unless $HOME/.hudson exists)
2. Run java -jar jenkins-cli.jar … login, creating $HOME/.hudson/cli-credentials on the server
3. Restart Jenkins, and it'll init with an empty home, as now $HOME/.hudson exists and is preferred to $HOME/.jenkins!
Code changed in jenkins
User: Daniel Beck
Path:
core/src/main/java/hudson/cli/ClientAuthenticationCache.java
http://jenkins-ci.org/commit/jenkins/237dda40e08f4db759e965738b1b9b3755525161
Log:
[FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it exists.