Generally, it is the best practice to use the latest version of a plugin. But there are ways to install custom plugins or outdated versions of a published plugin. Jenkins Plugins are exported using a .hpi file and the same can be installed in multiple ways -
Using the Jenkins CLI
java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin SOURCE ... [-deploy] [-name VAL] [-restart]
The above command Installs a plugin either from a file, an URL or from the update center.
- SOURCE: If this points to a local file, that file will be installed. If this is an URL, Jenkins downloads the URL and installs that as a plugin. Otherwise, the name is assumed to be the short name of the plugin in the existing update center (like "findbugs") and the plugin will be installed from the update center.
- -deploy: Deploy plugins right away without postponing them until the reboot.
- -name VAL: If specified, the plugin will be installed as this short name (whereas normally the name is inferred from the source name automatically).
- -restart: Restart Jenkins upon successful installation.
Advanced Installation - via - Web UI
Assuming a .hpi file has been downloaded, a logged-in Jenkins administrator may upload the file from within the web UI:
- Navigate to the Manage Jenkins > Manage Plugins page in the web UI.
- Click on the Advanced tab.
- Choose the .hpi file under the Upload Plugin section.
- Upload the plugin file.
- Restart the Jenkins instance
Advanced Installation - via - On the master
Assuming a .hpi file has been explicitly downloaded by a systems administrator, the administrator can manually place the .hpi file in a specific location on the file system.
Copy the downloaded .hpi file into the JENKINS_HOME/plugins directory on the Jenkins controller (for example, on Debian systems JENKINS_HOME is generally /var/lib/jenkins).
The master will need to be restarted before the plugin is loaded and made available in the Jenkins environment.