Coverage Badges Extension

Build Coverage LOC Contributors GitHub release Jenkins Plugin Installs GitHub license


This plugin is an extension of the embeddable-build-status. It adds the ability to display coverage metrics badges for jobs and pipeline recording coverage using coverage plugin


The plugin offer new placeholders to display coverage badges in the build status badge.

It works only when the job or pipeline is reporting the coverage using recordCoverage step from the coverage plugin

Following placeholder are

  • instructionCoverage : Display the instruction coverage percentage
  • branchCoverage : Display the branch coverage percentage
  • lineOfCode : Display the total line of code
  • numberOfTest : Display the number of test
  • colorInstructionCoverage: Display the color of the instruction coverage
  • colorBranchCoverage: Display the color of the branch coverage

For example a coverage badge can be displayed like this


It will render a badge like this (example with 50% coverage)

coverage badge

Or for the total line of code


It will render a badge like this

line of code badge

Or even the number of test


It will render a badge like this

number of test badge

Please refer to the embeddable-build-status for more information about the different URL to access the badges.

Example declarative Pipeline

If the Jenkins controller has a tool configured for "maven-3.9.6" and "jdk-21" and has the appropriate plugins installed, the following declarative Pipeline provides a working example:

pipeline {
    agent {
        label '!windows'
    tools {
        maven 'maven-3.9.6'
        jdk 'jdk-21'
    stages {
        stage('Checkout') {
            steps {
                git ''
        stage('Build & Test') {
            steps {
                sh 'mvn -P enable-jacoco clean verify'
    post {
        always {
            recordCoverage tools: [[pattern: 'target/site/jacoco/jacoco.xml']]
            echo 'Coverage results embeddable build status build URL is:\n' +
                 env.BUILD_URL + '/badge/icon' +
            echo 'Coverage results embeddable build status job URL is:\n' +
                 env.JOB_URL + '/badge/icon' +


CONTRIBUTING file and make sure it is appropriate for your plugin, if not then add your own one adapted from the base file

Refer to our contribution guidelines


Licensed under MIT, see LICENSE