方法一
卸载重装 简单粗暴以免后患
终端执行命令
/Library/Application Support/Jenkins/Uninstall.command
或者执行命令
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm !$
sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins
sudo rm -rf /Users/Shared/Jenkins
# if you want to get rid of all the jobs and builds:
sudo dscl . -delete /Users/jenkins
# delete the jenkins user and group (if you chose to use them):
sudo dscl . -delete /Groups/jenkins
或者command + shift+g 进入下面路径 双击 Uninstall.command
/Library/Application\ Support/Jenkins/Uninstall.command
方法二 也是我使用的方法
进入如下路径
/Users/Shared/Jenkins/Home/config.xml
复制一份config.xml 有备无患
再复制第二份用来修改
在config.xml中找到如下代码段
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
<denyAnonymousReadAccess>true</denyAnonymousReadAccess>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
然后保存替掉/Users/Shared/Jenkins/Home/config.xml
重启jenkins服务
在终端关闭
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
在终端开启
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
一开一闭重启完成
用浏览器打开 http://localhost:8080
重新设置安全选项,修改密码或重新注册即可重新使用jenkins。
方法三
https://blog.csdn.net/jianglianye21/article/details/78082445
这个方法我没走通,或许对你有用。