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

HudsonHudson PluginsJenkins

Hudson Problem Overview


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?

Hudson Solutions


Solution 1 - 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. 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 the cvs.hpi file and the cvs directory.

After that, restart Hudson/Jenkins and the plugin won't be there anymore.

Solution 2 - Hudson

Jenkins 1.487 adds a UI for uninstalling plugins: JENKINS-3070

Solution 3 - Hudson

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,

  • 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
  • restart hudson

Solution 4 - 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.

Solution 5 - Hudson

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..

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJim HurneView Question on Stackoverflow
Solution 1 - HudsonMark RushakoffView Answer on Stackoverflow
Solution 2 - HudsonJesse GlickView Answer on Stackoverflow
Solution 3 - HudsonneoscribeView Answer on Stackoverflow
Solution 4 - HudsonflipView Answer on Stackoverflow
Solution 5 - HudsonSampathView Answer on Stackoverflow