How to Install a Jenkins Plugin in 5 Minutes
Just as the title says, this tutorial will show you how to quickly and easily install and manage Jenkins plugins.
Join the DZone community and get the full member experience.Join For Free
The main thing that makes Jenkins useful to any kind of project is its plugins. They are extensions beyond the core to give superpowers to your project on the right dose. That maintains a light Jenkins core and enable projects with Java, .NET, PHP, and many other types to be automated.
This article will cover how to identify plugins already installed and how to install new ones, search, update and so on. To install Jenkins and understand the basics of the initially suggested plugins, check Getting Started with Jenkins - The Ultimate Guide.
Note that a new Jenkins version (2.107.2) is available but this article will keep the 2.73.3 version used in the previous articles.
After the login, on the left, there is a menu
Manage Jenkins. This is the place to set up any specific configuration to your Jenkins. If you are using the version 2.73.3 you may have noticed the big warning to update to the most recent Long-Term Support (LTS) version.
Manage Plugins will be the only place to care about in this article.
Following the standard installation, the Installed tab will have a bunch of plugins. If none of the suggested plugins were marked for installation, this tab will be empty.
Using Jenkins as a kind of Cron, scheduling tasks on background, no plugins will be necessary. But to create an automation to the simplest project you will need at least a version control system adapter as SVN or GIT to get your source code.
Not all plugins can be uninstalled directly (button placed on the last column). Some of them are dependencies to others so Jenkins will show a message for the ones that can’t be uninstalled. The same scenario is applied on disabling plugins (checkbox in the first column).
After uninstalling or disabling any plugin, Jenkins needs a restart to get things done. You may need to scroll down for a while to reach the end of the page due to the number of plugins. Make sure that no job is running at this moment.
Searching, Installing, Updating…
Installing and searching for plugins is a pretty simple task. Just need to access the Available tab. Jenkins will list all available plugins separated by session. The easy way is using the filter field. Type whatever you want and mark as many plugins as you want using the filter and Jenkins will keep everything you marked. When you are done, just click on
Install without restart to apply your needs. If you want deep details of each plugin, check official page of Jenkins Plugins.
Installing without restart is an old feature to avoid rebooting Jenkins so you can test new plugins faster (see this article from Kohsuke). But you can also restart if you prefer.
Considering that Jenkins community is quite active, plugins are receiving constant updates to improve features or to fix bugs. The tab
Updates will always warn you the plugins which need updates. Sometimes a Jenkins update will be asked for too. In the same way as uninstalling and disabling, updating plugins needs Jenkins restart to apply modifications.
As the tab says, this is an Advanced topic that this article will not cover but basically, it enables to upload plugins, change the URL that Jenkins check for updates or configuring proxies.
Time to play! Dealing with Jenkins plugins is very important during the automation process. Many of your problems maybe already solved by plugins, you only need to install it. A very good example is checking out your project using GIT. There are no needs to create a Shell Script to clone it, just use the GIT plugin and earn many other features for free.
Here is a very simple action to put everything into practice:
- Install Jenkins without the suggested plugins (use docker to speed up the process if you want);
- Take one or two plugins. Use the list from Getting Started with Jenkins - The Ultimate article to help in the process;
- Install only the ones that make sense to your project (maybe you just need GIT or Subversion initially).
Done! You have just learned how to deal with any plugin on Jenkins. Now, in less than five minutes, you have the skill to search and install the desired plugin.
If you have any problem during this process leave a comment below.
PS.: The Cyborg Developer initiative offers a FREE email course about software automation in 3 steps. You can subscribe here. You will also receive tips and tricks about automation directly to your mailbox (relax, I hate spam as much as you hate). Follow me on twitter @rcmoutinho.
Published at DZone with permission of Rodrigo Moutinho. See the original article here.
Opinions expressed by DZone contributors are their own.