How do I uninstall a plugin from Jenkins (Hudson)? - 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?

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.

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

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

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.

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

Related

Finding unused plugins in HUdson

I am using Hudson 3.3.1 in my org and I see a bunch of unwanted plugins being added to the hudson. I am planning to get rid of those unwanted or unused plugin. I thought of scanning all the job config files, but I have following questions.
If there are plugins that not being used by hudson job configs, but used by hudson configuration, What\which files should I search for?
In configs what should I be searching for. Pages what ever I am searching for is redirecting to jenkins pages.
I read through the following post How to list all unused jenkins plugins?
I tried installing this plugin http://updates.jenkins-ci.org/download/plugins/plugin-usage-plugin/ , but it started throwing out error as I believe it is supported only by jenkins
I added an answer to the question you linked that adds steps on how to search the main Jenkins configuration file as well as individual job config files. If you use the code in the linked question you should be able to find all the used plugins.

Hudson plugin installation

I am trying to install M2release plugin in Hudson.
I cannot install plugin using Hudson plugin update page due to lack of proxy settings. So i downloaded hpi file and used upload plugin option to deploy it.
Now Hudson home[directory] is showing the plugin inside plugin directory but i can't see the plugin in list of installed plugins on Hudson UI also plugin is not available on job configuration page. I hvae already bounced hudson server twice.
What am i missing here? Any additional steps are needed to install plugin manually?
Your steps seem fine.Since M2release plugin has moved to Jenkins now, so make sure you downloaded the compatible version with Hudson.

How to package hudson.war with extra plugins installed by default

I am wondering if it is possible to re-package the basic hudson.war with some extra plugins so they are installed by default for the end user. If so, what is the process to do this?
I've got a hudson.war which I start up, and then I manually install the plugins that are needed. Is there a way to reverse this process, and create a new hudson.war with the consequent files so that these plugins are installed by default?
Thank you,
-Denali
Theoretically, you could achieve this by adding your .hpi file into the WEB-INF/plugins folder of the hudson.war.
However, I don't think this is a clean approach. Have you considered automating it somehow by using the Hudson cli for instance?
Eg.
java -jar hudson-cli.jar -s http://<hudson_url> install-plugin <your-plugin>.hpi

m2eclipse on windows with Mercurial does not allow hg to be used on the "Check out Maven Projects from SCM" wizard

I followed the answer from this posting:
How to use Mercurial, Maven and Eclipse together?
But the "Check out Maven Projects from SCM" still does not allow me to use Mercurial SCM.
The only option I get is "svn" in the dropdown, and even if I ignore the drop down and enter in "scm:hg:http://myMercurialRepoURL"
I'm using:
Eclipse 3.6.1
m2eclipse 0.12 from http://m2eclipse.sonatype.org/sites/m2e
"Maven SCM handler for Subclipse" 0.12.0 from m2eclipse extra's site (sorry, I would give the URL, but my new account doesn't have enough rep)
MercurialEclipse 1.8.1 from http://cbes.javaforge.com/update
And I've uninstalled, and reinstall those plugins in that order.
I'm able to use Maven in projects, and use Mercurial separately in Eclipse - it's just this one Wizard that seems to be broken, which leads me to believe that if I try to Materialize an Artifact from a Mercurial repo that it will also fail.
Has anyone had any luck with this Wizard? Perhaps on earlier versions? Is this a new bug?
Thanks
As far my search went, I didn't get to find a suitable connector for mercurial and m2eclipse (in terms of only using IDE). However, I did an experiment wherein I cloned a copy of the source from outside the IDE. (via TortoiseHg specifically)
Afterwards, assuming you have already m2e installed in Eclipse:
Go to File > import > maven > existing maven projects, then select the folder where you've originally pulled/cloned your source code.
I believe by doing so, you'll see the m2e commands in the project's context menu (via run as), and effective use mercurial commands. (via team context menu)
At least for now, this is better not using m2e and mercurial at the same time.
If anyone has a more streamlined approach, I'm also curious. :D

Updating Hudson and plugins

I was wondering which steps are the best to upgrade hudson and the plugins.
I'm running 1.347 at the moment. I once tried to update which resulted into a mess because some plugins were incompatible.
Also i want to delete some plugins is it appropriate to just delete the hpi file? It would be nice to know how other people do this step and in which order.
Should i first upgrade hudson and then plugin by plugin?
And if a plugin breaks something downgrade it again? It seems to be a lot of work.
Or is there any easy way?
Also is it enough to save all the xml configuration files in case something breaks that i can recover?
Thanks in advance.
My solution is overkill, but I was burned twice (once by a Hudson bug and once by plugin incompatibilities) and learned my lesson.
I have Hudson installed on a VM with the same plugins as my production instance and a couple of simple builds. When I feel it's time to upgrade, or want to check out the latest release, I upgrade Hudson on the VM and verify that it starts up and can do builds. I only upgrade the production system that all of our developers use after I've upgraded my test system. I generally don't do exhaustive tests on my test system; it's enough to make sure the combination of upgraded Hudson and plugins starts up properly.
When upgrading either the VM or the main system, I upgrade all the plugins, then upgrade Hudson itself and restart. (Since I have a test system, I'm not particularly worried about doing things step by step.)
I came up with my process before Hudson introduced downgrade support. I still use this process because it's important to me to have confidence that an upgrade is not going to break the system that other developers use. This setup also allows me to have an experimental setup that's separate from the main Hudson system, which I find useful.
I usually update Hudson first, then the plugins.
The recent versions of Hudson have some support for this process:
the Hudson 1.376 added downgrade support for the core and plugins.
That means after upgrading a plugin, you have a button which allows you to downgrade to the previous installed version if needed.
the Hudson 1.369 Avoid error with invalid or null primary view, such as in upgrade from older Hudson
And the upcoming Hudson 1.387 will avoid littering HUDSON_HOME with atomic *.xml files, which should make the backup process of critical config files that much easier.
(Currently, with an Hudson 1.386, I see under HUDSON_HOME:
com.mtvi.plateng.hudson.ldap.LdapMailAddressResolver.xml
config.xml hudson.scm.SubversionSCM.xml
de.fspengler.hudson.pview.PViewProjectProperty.xml hudson.tasks.Ant.xml
hudson.maven.MavenModuleSet.xml hudson.tasks.Mailer.xml
hudson.model.UpdateCenter.xml hudson.tasks.Maven.xml
hudson.plugins.clearcase.ClearCaseInstallation.xml hudson.tasks.Shell.xml
hudson.plugins.clearcase.ClearCaseSCM.xml hudson.triggers.SCMTrigger.xml
hudson.plugins.git.GitTool.xml nodeMonitors.xml
hudson.plugins.sonar.SonarPublisher.xml proxy.xml
hudson.scm.CVSSCM.xml
)