简体   繁体   English

如何从Jenkins(Hudson)卸载插件?

[英]How do I uninstall a plugin from Jenkins (Hudson)?

I have a few plugins in my Jenkins installation which I no longer need. 我的Jenkins安装中有一些插件,我不再需要它。 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? 完全删除Jenkins(Hudson)插件的正确过程是什么?

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. 正如Jesse Glick在他的回答中所提到的,如果您使用的是Jenkins 1.487或更高版本,那么在Jenkins UI中有一种本地方法可以卸载插件。 See JENKINS-3070 for details. 有关详细信息,请参阅JENKINS-3070

If you are using a version of Jenkins earlier than 1.487, then you can try manually uninstalling the plugin. 如果您使用的是早于1.487的Jenkins版本,则可以尝试手动卸载该插件。 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). 正如一些人在评论中指出的那样,这可能不适用于某些平台(在这些情况下,升级到至少1.487以便您可以使用官方卸载功能)。

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. 要手动卸载插件,请停止Hudson / Jenkins,转到HUDSON_HOME/plugins目录并删除.hpi文件和具有相同名称的文件夹。 So, if you were going to remove the CVS plugin, you would remove both the cvs.hpi file and the cvs directory. 因此,如果您要删除CVS插件,则会删除cvs.hpi文件和cvs目录。

After that, restart Hudson/Jenkins and the plugin won't be there anymore. 之后,重新启动Hudson / Jenkins,插件将不再存在。

Jenkins 1.487添加了一个用于卸载插件的UI: JENKINS-3070

Deleting the <plugin>.hpi file and corresponding <plugin>-plugin directory will effectively remove the plugin. 删除<plugin> .hpi文件和相应的<plugin> -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. 但是如果您已在作业中配置了属于插件的参数,则 Hudson或tomcat日志可能包含* CannotResolveClassException:hudson.plugins ... *例外,因为它会尝试加载插件。 This can result in build failures even if build is successful . 即使构建成功,这也可能导致构建失败。

To fix that, 为了解决这个问题

  • go to the job configuration and save it again. 转到作业配置并再次保存。 This should get rid of the plugin reference 这应该摆脱插件引用
  • if not, go into the hudson home jobs directory and open the config.xml found under the folder named after the job and remove the reference to the plugin 如果没有,进入hudson home jobs目录并打开找到该作业后命名的文件夹下的config.xml并删除对该插件的引用
  • restart hudson 重启哈德森

Hudson插件解释说,一些核心插件(“Tier 1”插件,因为它们被称为)随Hudson本身一起提供,因此我认为不能删除。

You can disable it using the Jenkins » Plugin Manager. 您可以使用Jenkins»插件管理器禁用它。 Go to Installed tab and untick the plugins you want to uninstall and restart Jenkins. 转到“已安装”选项卡,取消选中要卸载的插件,然后重新启动Jenkins。 Though it does not unintall, at least keeps it away from appearing from configuration pages.. 虽然它不是unintall,但至少要远离配置页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM