0
0
Jenkinsdevops~5 mins

Jenkins plugin system concept - Commands & Configuration

Choose your learning style9 modes available
Introduction
Jenkins plugins add extra features to Jenkins so it can do more things. They help Jenkins connect with other tools and customize how it works without changing the main program.
When you want Jenkins to support a new programming language or tool for building your projects.
When you need Jenkins to send notifications to your team through email or chat apps.
When you want to add security features like user authentication or role-based access control.
When you want to integrate Jenkins with cloud services to deploy your applications automatically.
When you want to customize the Jenkins user interface or add new build steps.
Commands
This command lists all installed plugins in Jenkins to see what features are currently available.
Terminal
jenkins-plugin-cli --list
Expected OutputExpected
Installed plugins: - git 4.11.3 - workflow-aggregator 2.6 - credentials 2.5.1 - email-ext 2.83 - matrix-auth 2.6.8
This command installs the 'git' and 'email-ext' plugins to add Git support and extended email notifications to Jenkins.
Terminal
jenkins-plugin-cli --install git email-ext
Expected OutputExpected
Installing plugins: git 4.11.3 email-ext 2.83 Plugins installed successfully. Restart Jenkins to activate.
This command restarts the Jenkins service so that newly installed plugins become active and usable.
Terminal
systemctl restart jenkins
Expected OutputExpected
No output (command runs silently)
Run this again to verify that the new plugins are installed and active.
Terminal
jenkins-plugin-cli --list
Expected OutputExpected
Installed plugins: - git 4.11.3 - workflow-aggregator 2.6 - credentials 2.5.1 - email-ext 2.83 - matrix-auth 2.6.8
Key Concept

If you remember nothing else from this pattern, remember: Jenkins plugins let you add new features easily without changing Jenkins core.

Common Mistakes
Trying to use a plugin immediately after installation without restarting Jenkins.
Plugins need Jenkins to restart to load properly; otherwise, new features won't work.
Always restart Jenkins after installing or updating plugins.
Installing plugins that are incompatible with the Jenkins version.
Incompatible plugins can cause Jenkins to fail or behave unpredictably.
Check plugin compatibility with your Jenkins version before installing.
Installing too many plugins without reviewing their necessity.
Unnecessary plugins can slow down Jenkins and increase security risks.
Only install plugins you need and keep Jenkins lean.
Summary
Use 'jenkins-plugin-cli --list' to see installed plugins.
Install new plugins with 'jenkins-plugin-cli --install plugin-name'.
Restart Jenkins to activate new plugins.
Verify plugin installation by listing plugins again.