Managing Plugins
1. Installing Plugins
Example: Install Plugin via UI
Manage Jenkins → Manage Plugins → Available tab → Search for "Docker" → Check "Docker Pipeline" → Install without restart
| Method | Description | Notes |
|---|---|---|
| UI Installation | Using Jenkins web UI to browse and install plugins | Requires admin access |
| CLI Installation | Using jcli or jenkins-plugin-manager |
Automated installation from command line |
| Plugin Manager API | Using Jenkins REST API to install plugins | Programmatic control over plugin lifecycle |
Note: Jenkins plugins can be installed from the official update center or custom repositories.
Warning: Installing plugins may require a Jenkins restart to activate them fully.
Installation Steps
- Navigate to
Manage Jenkins → Manage Plugins - Select the
Availabletab - Search or browse for desired plugin
- Check the checkbox next to the plugin name
- Click
Install without restartorRestart Jenkins
2. Updating Plugins
| Plugin | Current Version | Latest Version | Status |
|---|---|---|---|
| Pipeline: Groovy | 5.0 |
5.1 |
NEW |
| Git | 4.10.2 |
5.0.0 |
DEPRECATED |
Example: Update Plugin via CLI
java -jar jenkins.war --updateCenterUrl=https://updates.jenkins.io/update-center.json
Note: Ensure Jenkins is stopped before running the update command.
Warning: Updating plugins may cause compatibility issues with existing jobs or configurations.
3. Uninstalling Plugins
| Plugin | Status | Action |
|---|---|---|
| Plugin Name | Installed | Uninstall via UI or CLI |
Example: Uninstalling via Jenkins UI
1. Navigate to Manage Jenkins > Manage Plugins
2. Go to the Installed tab
3. Find the plugin in the list
4. Click Uninstall next to the plugin name
5. Confirm uninstallation
Example: Uninstalling via CLI
jenkins-plugin-cli --plugins plugin-name:version --output-dir /path/to/plugins
Note: Ensure no jobs or configurations depend on the plugin before uninstalling.
Warning: Uninstalling plugins may break jobs or configurations that rely on them.
4. Using Plugin Dependencies
| Property | Description | Example |
|---|---|---|
| plugin.dependencies | Defines the dependencies of a Jenkins plugin | plugin.dependencies = ['workflow-api@2.38', 'credentials@2.1.17'] |
Example: Declaring Plugin Dependencies in Jenkinsfile
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'echo "Building..."'
}
}
}
post {
always {
echo 'Build completed'
}
}
}
Note: Plugin dependencies are declared in the
plugins section of the Jenkinsfile or in the plugin's plugin.xml file.
Warning: Ensure that all plugin dependencies are compatible with the Jenkins version and other plugins in use.
5. Configuring Plugin Update Center
| Property | Default Value | Description |
|---|---|---|
| hudson.plugins.plugin_manager.PluginManager$UpdateCenter | default |
Defines the update center for plugin installations |
Example: Configure Update Center URL
import jenkins.model.Jenkins
import hudson.plugins.plugin_manager.PluginManager
def jenkins = Jenkins.instance
def pluginManager = jenkins.getPluginManager()
def updateCenter = pluginManager.getUpdateCenter()
updateCenter.setUrl("https://updates.jenkins.io/update-center.json")
Note: The update center URL can be overridden to use a custom or internal update center for enterprise environments.
Warning: Modifying the update center URL may affect plugin installation and update behavior. Ensure that the new URL is valid and accessible.
6. Installing Plugins Manually
Example: Manual Plugin Installation via UI
<div class="note"><strong>Note:</strong> Navigate to "Manage Jenkins" > "Manage Plugins" > "Available" tab.</div>
<div class="codeBlock"><pre><code>1. Click "Upload Plugin"
2. Select .hpi file from local system
3. Click "Upload"</code></pre></div>
| Step | Description | Notes |
|---|---|---|
| Upload Plugin | Manage Jenkins > Manage Plugins > Available |
Upload .hpi file directly from filesystem |
| Plugin File | .hpi |
Must be valid Jenkins plugin archive |
| Installation Method | Manual Upload |
Does not require internet access |
Note: Manual installation bypasses plugin repository checks and requires manual verification of plugin compatibility.
Warning: Installing plugins manually can introduce security vulnerabilities if the plugin source is untrusted.
7. Using Plugins CLI
| Option | Values | Description |
|---|---|---|
| --plugins | plugin-name:version |
Plugin(s) to install, comma-separated |
| --output-file | plugins.txt |
Output file to write plugin list |
| --plugin-version-strategy | latest|stable|recommended |
Version resolution strategy |
Note: The Jenkins Plugin CLI tool requires Java 11 or higher to run.
Warning: Ensure Jenkins is running and accessible before installing plugins via CLI.
8. Managing Plugin Versions
| Plugin | Version | Status | Notes |
|---|---|---|---|
| Pipeline: Groovy | 5.0 |
NEW | Latest stable version with enhanced syntax support |
| Docker Pipeline | 1.25 |
DEPRECATED | Replaced by Docker Pipeline Plugin in newer versions |
| Git | 5.2.0 |
Stable | Supports GitLab and GitHub integration |
Example: Installing a Specific Plugin Version
curl -X POST "http://jenkins.example.com/pluginManager/install?pluginId=workflow-aggregator&version=2.39"
Note: Plugin versions can be managed via the Jenkins UI or CLI. Use
jenkins-plugin-manager for automated updates.
Warning: Downgrading plugins may cause compatibility issues or break builds.
9. Resolving Plugin Conflicts
Note: Plugin conflicts can arise when multiple plugins attempt to use the same resources or override each other's functionality.
| Conflict Type | Description | Solution |
|---|---|---|
| Resource Conflicts | Plugins using the same resource (e.g., port, file path) | Adjust plugin configurations to use unique resources |
| Dependency Conflicts | Plugins requiring different versions of the same dependency | Update or downgrade plugins to compatible versions |
| API Version Conflicts | Plugins using different versions of the same API | Ensure all plugins are compatible with the Jenkins version |
Example: Checking Plugin Dependencies
curl -s http://localhost:8080/pluginManager/api/json?depth=1 | jq '.plugins[] | {name: .shortName, version: .version, dependencies: .dependencies}'
Workflow to Resolve Plugin Conflicts
- Identify conflicting plugins using the Jenkins UI or API
- Review plugin dependencies and versions
- Update or uninstall conflicting plugins to resolve version mismatches
- Restart Jenkins after making changes
- Verify that the system functions as expected
Plugin Conflict Resolution Approaches
- Manual Resolution: Manually adjust plugin configurations or versions
- Automated Tools: Use Jenkins plugins like "Plugin Usage Statistics" to detect conflicts
- Rollback: Revert to a known stable plugin configuration