0
0
Jenkinsdevops~5 mins

Plugin update management in Jenkins - Commands & Configuration

Choose your learning style9 modes available
Introduction
Jenkins plugins add extra features to your Jenkins server. Keeping plugins updated fixes bugs and adds new features, making your server safer and more reliable.
When you want to add new capabilities to Jenkins like Git integration or pipeline support
When a plugin has a security update that protects your server
When a plugin update fixes bugs causing build failures
When you want to use new features introduced in the latest plugin versions
When you want to keep Jenkins stable by avoiding outdated plugins
Commands
This command lists all installed plugins on your Jenkins server with their current versions.
Terminal
java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins
Expected OutputExpected
ace-editor 1.1 ansicolor 0.7.0 git 4.10.0 pipeline 2.6
This command updates the 'git' and 'pipeline' plugins to their latest versions and deploys them immediately.
Terminal
java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin git pipeline -deploy
Expected OutputExpected
Installing plugin: git Installing plugin: pipeline Plugins installed successfully. Restart Jenkins to apply changes.
-deploy - Deploys the plugin immediately without waiting for a restart
This command restarts Jenkins safely to apply plugin updates without interrupting running jobs.
Terminal
java -jar jenkins-cli.jar -s http://localhost:8080/ safe-restart
Expected OutputExpected
Jenkins is restarting. Safe restart in progress...
After restart, this command verifies that plugins have been updated to the latest versions.
Terminal
java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins
Expected OutputExpected
ace-editor 1.1 ansicolor 0.7.0 git 4.11.0 pipeline 2.7
Key Concept

If you remember nothing else from this pattern, remember: always restart Jenkins safely after updating plugins to apply changes without breaking running jobs.

Common Mistakes
Updating plugins without restarting Jenkins
Plugin updates do not take effect until Jenkins restarts, so changes won't apply
Use 'safe-restart' command after plugin updates to apply changes properly
Updating plugins without checking compatibility
Some plugin updates may not be compatible with your Jenkins version causing failures
Check plugin compatibility on Jenkins update center before updating
Running plugin update commands without Jenkins CLI authentication
Commands fail because Jenkins requires authentication for CLI operations
Configure Jenkins CLI with proper authentication tokens or credentials
Summary
List installed plugins and their versions using Jenkins CLI.
Update specific plugins with the install-plugin command and deploy them.
Restart Jenkins safely to apply plugin updates without interrupting jobs.
Verify plugin versions after restart to confirm updates.