如何从 Jenkins (Hudson) 卸载插件?
我的 Jenkins 安装中有一些我不再需要的插件。我已经禁用了插件(并且我的构建仍然有效),并且我想完全删除插件。完全删除 Jenkins (Hudson) 插件的正确流程是什么?
I have a few plugins in my Jenkins installation which I no longer need. I've already disabled the plugins (and my build still work), and I'd like to remove the plugins completely. What is the right process for completely removing a Jenkins (Hudson) plugin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
正如 Jesse Glick 在他的回答中提到的,如果您使用的是 Jenkins 1.487 或更高版本,那么有一种本机方式可以卸载Jenkins UI 中的插件。有关详细信息,请参阅 JENKINS-3070。
如果您使用的 Jenkins 版本早于 1.487,那么您可以尝试手动卸载该插件。正如一些人在评论中指出的那样,这可能在某些平台上不起作用(在这些情况下,请至少升级到 1.487,以便您可以使用官方卸载功能)。
要手动卸载插件,请停止 Hudson/Jenkins,转到
HUDSON_HOME/plugins
目录并删除.hpi
文件和同名文件夹。因此,如果您要删除 CVS 插件,则需要删除cvs.hpi
文件和cvs
目录。之后,重新启动 Hudson/Jenkins,该插件将不再存在。
As mentioned by Jesse Glick in his answer, if you are using Jenkins 1.487 or higher, then there is a native way to uninstall plugins in the Jenkins UI. See JENKINS-3070 for details.
If you are using a version of Jenkins earlier than 1.487, then you can try manually uninstalling the plugin. As some people point out in the comments, this may not work on some platforms (in those cases, upgrade to at least 1.487 so that you can use the official uninstall feature).
To manually uninstall a plugin, stop Hudson/Jenkins, go to your
HUDSON_HOME/plugins
directory and remove both the.hpi
file and the folder with the same name. So, if you were going to remove the CVS plugin, you would remove both thecvs.hpi
file and thecvs
directory.After that, restart Hudson/Jenkins and the plugin won't be there anymore.
Jenkins 1.487 添加了用于卸载插件的 UI: JENKINS-3070
Jenkins 1.487 adds a UI for uninstalling plugins: JENKINS-3070
删除.hpi 文件和相应的-plugin 目录将有效删除插件。
但是,如果您在作业中配置了属于插件的参数,您的 Hudson 或 tomcat 日志可能包含 *CannotResolveClassException: hudson .plugins ... * 异常,因为它尝试加载插件。即使构建成功,这也可能导致构建失败。
要解决此问题,
Deleting the <plugin>.hpi file and corresponding <plugin>-plugin directory will effectively remove the plugin.
However, if you have configured parameters that belong to the plugin within your jobs your Hudson or tomcat logs may contain *CannotResolveClassException: hudson.plugins ... * exceptions because it attempts to load the plugin. This can result in build failures even if build is successful.
To fix that,
Hudson 插件 解释了一些核心插件(“Tier 1”插件,因为它们被称为)是随 Hudson 本身一起提供的,因此我认为不能删除。
Hudson Plugins explains that some core plugins ("Tier 1" plugins, as they are called) are shipped with Hudson itself, and I assume cannot be deleted therefore.
您可以使用 Jenkins » 插件管理器禁用它。转到“已安装”选项卡,取消选中要卸载的插件并重新启动 Jenkins。虽然它不会卸载,但至少让它不会出现在配置页面中。
You can disable it using the Jenkins » Plugin Manager. Go to Installed tab and untick the plugins you want to uninstall and restart Jenkins. Though it does not unintall, at least keeps it away from appearing from configuration pages..