65

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Jim Hurne
  • 7,187
  • 4
  • 44
  • 44

5 Answers5

84

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.

Community
  • 1
  • 1
Mark Rushakoff
  • 249,864
  • 45
  • 407
  • 398
  • 1
    Yes, no way to uninstall it from the GUI. See http://issues.hudson-ci.org/browse/HUDSON-3070 – pihentagy Mar 10 '11 at 10:40
  • 4
    @Mark Today I removed a bunch of plugins but the cvs plugin keeps getting re-created. Any ideas how to remove this permanently? – Besi Sep 02 '11 at 08:01
  • 4
    No matter what I do, all deleted plugins files are created again when I start Jenkins. – Željko Filipin Oct 26 '11 at 14:15
  • 3
    This method does not work when running Jenkins on Win Svr 2008 R2. When stopping, deleting the files, and then restarting the service, the files are then recreated in the file system automatically. – Jason Feb 23 '12 at 03:06
  • The correct issue is https://issues.jenkins-ci.org/browse/JENKINS-3070 - vote for it! – sorin Jul 30 '12 at 15:38
  • Please do let me know where do i find the .hpi file. Because i dont find any .hpi file – krs Aug 13 '13 at 06:37
  • Manual deletion worked for me on Windows. One note I would like to add is that the files were locked and I had to [restart Jenkins service](https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins) in order to delete them. These command might be helpful: `net stop jenkins` and `net start jenkins` – Nikita R. Jul 17 '15 at 17:05
  • It worked for me, but I had to remove .jpi files, not .hpi ("Hudson" -> "Jenkins"?) – Igor Brejc Sep 30 '15 at 07:47
13

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

Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
7

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
neoscribe
  • 2,203
  • 1
  • 21
  • 18
  • This advice is obsolete on both counts: first, there is a UI for deleting plugins; second, there is a UI for discarding old configuration data in bulk. – Jesse Glick Dec 11 '14 at 12:56
  • 2
    Actually, the UI for deleting plugins was there at the time this was written in 2012. The issue I ran into at that time could not be resolved from the UI because the plugin triggered an exception in Hudson, thus the post. I don't think it is obsolete for anyone who runs into those conditions. – neoscribe Dec 12 '14 at 00:33
  • You can use _Manage Old Data_ (an administrative monitor) to review and discard any configuration belonging to now-removed plugins. There is no need to reconfigure individual jobs, edit files on disk, or restart. This has been there since 1.390 (Mar 2010). – Jesse Glick Dec 12 '14 at 14:39
  • The advice is still valid. If you've installed a plugin that has a bug in it, there's a chance it will throw exceptions everywhere in the web client. Then the only option is to delete the hpi manually. – Nikita R. Jul 17 '15 at 17:03
3

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.

Community
  • 1
  • 1
flip
  • 31
  • 1
  • 1
    ty! That is why the 'Uninstall' button is not present for those items. I was annoyed being asked to update items I don't use, but since I must keep them, I am updating :). – AnneTheAgile Dec 04 '14 at 17:23
  • It would be misleading to even offer to delete bundled plugins, since with no record of them even having been disabled, Jenkins would simply start loading them again after the next startup. – Jesse Glick Dec 11 '14 at 12:58
1

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

Sampath
  • 119
  • 1
  • 4