Common Plugins
A handful of essential plugins power most real-world Jenkins pipelines.
While there are thousands of plugins, a small core set appears in almost every setup. Knowing these covers most needs.
Essential plugins
- Pipeline (workflow-aggregator) — the whole declarative/scripted pipeline system.
- Git — clone and interact with Git repositories.
- Docker Pipeline — build images and run steps in containers.
- Credentials Binding — inject secrets into builds.
- Blue Ocean — a modern, visual pipeline UI.
- JUnit — publish test results and trends.
- Slack / Email Extension — send build notifications.
Choosing plugins
Prefer popular, actively maintained plugins. Check the install count and last release date on the plugin page.
Example
# Most-used plugin IDs (for automated installs):
workflow-aggregator # Pipeline
git # Git
docker-workflow # Docker Pipeline
credentials-binding # inject secrets
junit # test reports
blueocean # visual UI
slack # Slack notificationsWhen to use it
- The Pipeline plugin is installed to unlock the Jenkinsfile-based declarative pipeline capability that Jenkins does not ship with by default.
- The Git plugin is added so Jenkins can check out any Git repository, which is required by nearly every real-world pipeline.
- The JUnit plugin is installed to parse test-report XML files and display a trend graph on the job page.
More examples
Publish JUnit results
Uses the JUnit plugin's junit step to publish Maven Surefire test results after every build.
post {
always {
junit 'target/surefire-reports/*.xml'
}
}HTML Publisher plugin usage
Uses the HTML Publisher plugin to serve an LCOV code-coverage report directly from the Jenkins build page.
post {
always {
publishHTML(target: [
allowMissing: false,
reportDir: 'coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'Coverage Report'
])
}
}Slack Notification plugin
Sends a red failure alert to a Slack channel using the Slack Notification plugin.
post {
failure {
slackSend(
channel: '#builds',
color: 'danger',
message: "FAILED: ${JOB_NAME} #${BUILD_NUMBER} (<${BUILD_URL}|Open>)"
)
}
}
Discussion