• Stars
    star
    139
  • Rank 253,551 (Top 6 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 12 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Jenkins JaCoCo Plugin

jacoco-plugin

Build Status Build Status Release

Jenkins Plugin GitHub release Jenkins Plugin Installs

A plugin for Jenkins to capture and visualize code coverage testing results for projects using the JaCoCo for code-coverage analysis.

More information can be found on the Wiki page https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin

Available options are described at https://www.jenkins.io/doc/pipeline/steps/jacoco/

Note: Version 2.0.0 and higher requires using JaCoCo 0.7.5 or newer, if your projects still use JaCoCo 0.7.4, the plugin will not display any code-coverage numbers any more! In this case please use version 1.0.19 until you can update jacoco in your codebase.

Using as part of a pipeline via Jenkinsfile

The following is an example snippet that can be used in a Jenkinsfile

    post {
        success {
            jacoco(
                execPattern: '**/build/jacoco/*.exec',
                classPattern: '**/build/classes/java/main',
                sourcePattern: '**/src/main'
            )
        }
    }

See https://www.jenkins.io/doc/pipeline/steps/jacoco/ for the list of available options.

Looking for ways to contribute?

When looking for things to work at there are pull requests and a list of Jenkins Issues.

In general the plugin is currently in "minimal maintenance" mode, i.e. no larger development is done due to the small number of active contributors and general time constraints.

Please speak up if you are interested in helping to maintain this plugin!

Discussion list

There is a developer list at https://groups.google.com/forum/#!forum/jenkins-jacoco-plugin-mailing-list, it is usually very low volume.

Contributing to the Plugin

Plugin source code is hosted on GitHub.

New feature proposals and bug fix proposals should be submitted as GitHub pull requests.

Fork the repository on GitHub, prepare your change on your forked copy, and submit a pull request (see here for open pull requests). Your pull request will be evaluated by this job.

Before submitting your change, please assure that you've added a test which verifies your change. There have been many developers involved in the jacoco plugin and there are many, many users who depend on the jacoco-plugin. Tests help us assure that we're delivering a reliable plugin, and that we've communicated our intent to other developers in a way that they can detect when they run tests.

Code coverage reporting is available as a maven target and is actively monitored. Please try your best to improve code coverage with tests when you submit.

Before submitting your change, please review the output of the checks that run in CI at https://ci.jenkins.io/job/Plugins/job/jacoco-plugin/ to assure that you haven't introduced new warnings.

How to build and test

  • Build the plugin:

mvn package

  • Test locally (invokes a local Jenkins instance with the plugin installed):

mvn hpi:run

See https://jenkinsci.github.io/maven-hpi-plugin/ for details.

How to release a new version

Rolling a release requires you to set up a few additional things:

  • Run with Java 11 to not push code compiled with a newer version of Java

  • Github authentication should work via SSH, username used should be "git", it should use one of the local private SSH keys which should be uploaded to Github, see https://github.com/settings/keys, test via

    ssh -T [email protected]

You should get back a line containing You've successfully authenticated

See also general documentation about releasing Jenkins plugins:

Basic information

This plugin allows you to capture code coverage report from JaCoCo. Jenkins will generate the trend report of coverage and some other statistics.

It also includes functionality to include columns in Dashboards which displays the latest overall coverage numbers and links to the coverage report.

Getting Started

The plugin provides two things, a build-publisher to record and display coverage data as part of builds as well as a new column-type for dashboard views which can display coverage data in Dashboards.

Recording coverage for builds

Get coverage data as part of your build

First you need to get coverage calculated as part of your build/tests, see the JaCoCo documentation
for details. You need at least one or more *.exec file available after tests are executed. Usually this means adjusting
your Maven pom.xml or Ant build.xml file..

Set up coverage retrieval and publishing

In order to get the coverage data published to Jenkins, you need to add a JaCoCo publisher and configure it so it will
find all the necessary information. Use the help provided via the question-mark links for more information. Basically
you specify where the *.exec files are, where compiled code can be found and where the corresponding source code is
located after the build is finished to let the plugin gather all necessary pieces of information..

Run the job

After the job executed, the build-output will show that the JaCoCo-publisher is executed and collects the data. This
output can also give hints if something goes wrong at this stage:

Zeichne Testergebnisse auf.
[JaCoCo plugin] Collecting JaCoCo coverage data...
[JaCoCo plugin] build/*.exec;build/*-classes;src/java,src/*/java,src/*/src; locations are configured
[JaCoCo plugin] Number of found exec files: 5
[JaCoCo plugin] Saving matched execfiles:  .../build/jacoco-excelant.exec .../build/jacoco-main.exec .../build/jacoco-ooxml-lite.exec
[JaCoCo plugin] Saving matched class directories:  .../build/examples-classes .../build/excelant-classes .../build/excelant-test-classes
[JaCoCo plugin] Saving matched source directories:  .../src/contrib/src .../src/examples/src .../src/excelant/java .../src/java
[JaCoCo plugin] Loading inclusions files..
[JaCoCo plugin] inclusions: []
[JaCoCo plugin] exclusions: [**/Test*]
[JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0,
minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
[JaCoCo plugin] Publishing the results..
[JaCoCo plugin] Loading packages..
[JaCoCo plugin] Done.
Look at results

If data gathering is successful, the build will include a link to the coverage results similar to the HTML report of
JaCoCo itself. The job page will be enhanced with a chart with the trend of code coverage over the last builds.

Coverage column

This part of the JaCoCo plugin allows you to add a new type of column to a project-table in the Dashboard view which
will show the coverage number of the last build for ajob together with some color coding which allows to quickly see
projects with low coverage.

The fill-color in use by the column is a continuous color-range with the following points:

  • PERFECT = 100.0
  • EXCELLENT at 97.0
  • GOOD at 92.0
  • SUFFICIENT at 85.0
  • FAIR at 75.0
  • POOR at 50.0
  • TRAGIC at 25.0
  • ABYSSMAL at 0.0
  • NA = No coverage configured

Open Tickets (bugs and feature requests)

See the Jenkins JIRA

Build Status


Troubleshooting

  • Unfortunately JaCoCo 0.7.5 breaks compatibility to previous binary formats of the jacoco.exec files. The JaCoCo plugin up to version 1.0.19 is based on JaCoCo 0.7.4, thus you cannot use this version with projects which already use JaCoCo 0.7.5 or newer. JaCoCo plugin starting with version 2.0.0 uses JaCoCo 0.7.5 and thus requires also this version to be used in your projects. Please stick to JaCoCo plugin 1.0.19 or lower if you still use JaCoCo 0.7.4 or lower

Change Log

For current versions see the changelog in the release-area at https://github.com/jenkinsci/jacoco-plugin/releases

Historic Change Log

Version 2.0.1 (Jan 15, 2016)

  • Fix the m2e lifecycle-mapping, #64
  • Integrate automated builds via travis-ci and show the build-state on the github page
  • Fix for JENKINS-31751 JaCoCo 2.0.0 plugin shows html instead of coverage report chart

Version 2.0.0 (Nov 23, 2015)

  • Major version change because the jacoco.exec file from the newer JaCoCo is binary incompatible with previous builds
  • Update to JaCoCo 0.7.5, this causes binary incompatibility! See #55
  • Add coverage summary on build status/result page. Thanks to Felipe Brandão for the patch, see #61

Version 1.0.19 (Apr 7, 2015)

  • Update used version of JaCoCo to 0.7.4

Version 1.0.18 (Dec 7, 2014)

  • Fix JENKINS-23708 NullPointerException if older JaCoCo reports are opened

Version 1.0.17 (Nov 25, 2014)

Version 1.0.16 (Jun 24, 2014)

Version 1.0.15 (Jun 11, 2014)

Version 1.0.14 (Nov 9, 2013)

Core JaCoCo plugin

Version 1.0.13 (Aug 22, 2013)

Core JaCoCo plugin

Coverage column:

Version 1.0.12 (Feb 22, 2013)

Version 1.0.11 (Feb 21, 2013)

Version 1.0.10 (Feb 05, 2013)

Version 1.0.9 (Nov 18, 2012)

Version 1.0.8 (Okt 15, 2012)

Version 1.0.7 (Okt 8, 2012)

Version 1.0.6 (Okt 2, 2012)

Version 1.0.5 (Sep 09, 2012)

  • Fixed JENKINS-15088: When the missed count is bigger than the covered, the redbar becomes too long

Version 1.0.4 (Sep 03, 2012)

  • Fixed JENKINS-14896: java.io.FileNotFoundException when saving module data

Version 1.0.3 (Aug 20, 2012)

  • New concept implemented JENKINS-14927: Use the EXEC files instead the XMLs
  • Fixed JENKINS-14279: Report "missed items" rather that coverage percentage
  • Fixed JENKINS-14159: 404 when trying to see coverage on java code (implementation of sourcefile highlighting)
  • New feature JENKINS-14274: Multi module reporting

Version 1.0.2 (Jul 01, 2012)

  • Fixed JENKINS-14270: The report does not show the covered/all, it shows something different

Version 1.0.1 (Jun 25, 2012)

  • Fixed testcases to have all the tests passed for a release
  • Fixed JENKINS-14203: The total summary is double counted

Version 1.0.0 (Jun 14, 2012)

  • Fixed 3 testcases to have all the tests passed for a release
  • Fixed POM: making it releasabl

More Repositories

1

jenkins

Jenkins automation server
Java
21,381
star
2

docker

Docker official jenkins repo
Dockerfile
6,144
star
3

pipeline-examples

A collection of examples, tips and tricks and snippets of scripting for the Jenkins Pipeline plugin
Groovy
4,117
star
4

blueocean-plugin

Blue Ocean is a reboot of the Jenkins CI/CD User Experience
Java
2,872
star
5

configuration-as-code-plugin

Jenkins Configuration as Code Plugin
Java
2,521
star
6

kubernetes-plugin

Jenkins plugin to run dynamic agents in a Kubernetes/Docker environment
Java
2,206
star
7

job-dsl-plugin

A Groovy DSL for Jenkins Jobs - Sweeeeet!
Groovy
1,851
star
8

pipeline-plugin

Obsolete home for Pipeline plugins
1,711
star
9

JenkinsPipelineUnit

Framework for unit testing Jenkins pipelines
Groovy
1,426
star
10

gitlab-plugin

A Jenkins plugin for interfacing with GitLab
Java
1,418
star
11

jenkinsfile-runner

A command line tool to run Jenkinsfile as a function
Java
1,114
star
12

java-client-api

A Jenkins API client for Java
Java
888
star
13

jenkins-scripts

Scripts in Groovy, shell, Ruby, Python, whatever for managing/interacting with Jenkins
Groovy
880
star
14

build-monitor-plugin

Jenkins Build Monitor Plugin
Java
722
star
15

slack-plugin

A Jenkins plugin for posting notifications to a Slack channel
Java
664
star
16

git-plugin

Git repository access for Jenkins jobs
Java
660
star
17

pipeline-model-definition-plugin

Groovy
557
star
18

ghprb-plugin

github pull requests builder plugin for Jenkins
Java
495
star
19

docker-workflow-plugin

Jenkins plugin which allows building, testing, and using Docker images from Jenkins Pipeline projects.
Java
492
star
20

docker-plugin

Jenkins Cloud Plugin that uses Docker
Java
482
star
21

docker-inbound-agent

Docker image for a Jenkins agent which can connect to Jenkins using TCP or Websocket protocols
PowerShell
466
star
22

helm-charts

Jenkins helm charts
Mustache
448
star
23

pipeline-aws-plugin

Jenkins Pipeline Step Plugin for AWS
Java
423
star
24

jenkins.rb

Deprecated, see https://www.jenkins.io/jep/7
Ruby
394
star
25

generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
Java
377
star
26

email-ext-plugin

Jenkins Email Extension Plugin
Java
338
star
27

dingtalk-plugin

Dingtalk for jenkins
Java
336
star
28

warnings-ng-plugin

Jenkins Warnings Plugin - Next Generation
Java
323
star
29

plugin-installation-manager-tool

Plugin Manager CLI tool for Jenkins
Java
301
star
30

mesos-plugin

Mesos Cloud Jenkins Plugin
Java
291
star
31

github-plugin

Jenkins GitHub plugin
Java
286
star
32

ec2-plugin

Jenkins ec2 plugin
Java
282
star
33

ssh-steps-plugin

Jenkins pipeline steps which provides SSH facilities such as command execution or file transfer for continuous delivery.
Java
273
star
34

ansicolor-plugin

Jenkins ANSI Color Plugin
Java
253
star
35

pipeline-utility-steps-plugin

Small, miscellaneous, cross platform utility steps for Jenkins Pipeline jobs.
Java
237
star
36

docker-agent

Base Docker image for Jenkins Agents
PowerShell
231
star
37

ansible-plugin

Jenkins Ansible plugin
Java
223
star
38

workflow-cps-global-lib-plugin

Java
223
star
39

lib-file-leak-detector

Java agent that detects file handle leak
Java
217
star
40

hashicorp-vault-plugin

Jenkins plugin to populate environment variables from secrets stored in HashiCorp's Vault.
Java
214
star
41

bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
Java
213
star
42

remoting

Jenkins Remoting module
Java
212
star
43

workflow-aggregator-plugin

211
star
44

gerrit-trigger-plugin

Java
209
star
45

android-emulator-plugin

Android Emulator plugin for Jenkins
Java
207
star
46

docker-slaves-plugin

A Jenkins plugin to run builds inside Docker containers
Java
205
star
47

pipeline-stage-view-plugin

Visualizes Jenkins pipelines
JavaScript
204
star
48

jenkinsfile-runner-github-actions

Jenkins single-shot pipeline execution in a GitHub Action POC
Shell
199
star
49

github-branch-source-plugin

GitHub Branch Source Plugin
Java
193
star
50

amazon-ecs-plugin

Amazon EC2 Container Service Plugin for Jenkins
Java
193
star
51

trilead-ssh2

Patched trilead-ssh2 used in Jenkins
Java
193
star
52

cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
Java
192
star
53

docker-build-publish-plugin

Java
192
star
54

performance-plugin

Performance Test Running and Reporting for Jenkins CI
Java
188
star
55

jira-plugin

Jenkins jira plugin
Java
168
star
56

gitea-plugin

This plugin provides the Jenkins integration for Gitea.
Java
168
star
57

embeddable-build-status-plugin

Embed build status of Jenkins jobs in web pages
Java
167
star
58

stashnotifier-plugin

A Jenkins Plugin to notify Atlassian Stash|Bitbucket of build results
Java
166
star
59

docker-ssh-agent

Docker image for Jenkins agents connected over SSH
PowerShell
162
star
60

workflow-cps-plugin

Java
160
star
61

http-request-plugin

This plugin does a request to an url with some parameters.
Java
154
star
62

stapler

Stapler web framework
Java
154
star
63

kubernetes-pipeline-plugin

Kubernetes Pipeline is Jenkins plugin which extends Jenkins Pipeline to provide native support for using Kubernetes pods, secrets and volumes to perform builds
Java
154
star
64

tfs-plugin

Jenkins tfs plugin
Java
145
star
65

jep

Jenkins Enhancement Proposals
Shell
144
star
66

kubernetes-cd-plugin

A Jenkins plugin to deploy to Kubernetes cluster
Java
140
star
67

qy-wechat-notification-plugin

企业微信Jenkins构建通知插件
Java
138
star
68

swarm-plugin

Jenkins swarm plugin
Java
133
star
69

git-client-plugin

Git client API for Jenkins plugins
Java
130
star
70

subversion-plugin

Jenkins subversion plugin
Java
126
star
71

dependency-check-plugin

Jenkins plugin for OWASP Dependency-Check. Inspects project components for known vulnerabilities (e.g. CVEs).
Java
125
star
72

role-strategy-plugin

Jenkins Role-Strategy plugin
Java
120
star
73

groovy-sandbox

(Deprecated) Compile-time transformer to run Groovy code in a restrictive sandbox
Java
120
star
74

jenkins-design-language

Styles, assets, and React classes for Jenkins Design Language
TypeScript
116
star
75

acceptance-test-harness

Acceptance tests cases for Jenkins and its plugins based on selenium and docker.
Java
116
star
76

scm-sync-configuration-plugin

Jenkins scm-sync-configuration plugin
Java
116
star
77

gitlab-branch-source-plugin

A Jenkins Plugin for GitLab Multibranch Pipeline jobs and Folder Organization
Java
115
star
78

git-parameter-plugin

Jenkins plugin for chosing Revision / Tag before build
Java
115
star
79

publish-over-ssh-plugin

Java
114
star
80

pipeline-as-yaml-plugin

Jenkins Pipeline As Yaml Plugin
Java
114
star
81

selenium-plugin

Jenkins selenium plugin
Java
112
star
82

docker-build-step-plugin

Java
111
star
83

code-coverage-api-plugin

Deprecated Jenkins Code Coverage Plugin
Java
111
star
84

jira-trigger-plugin

Triggers a build when a certain condition is matched in JIRA
Groovy
111
star
85

cobertura-plugin

Jenkins cobertura plugin
Java
110
star
86

gradle-plugin

Jenkins gradle plugin
Java
109
star
87

credentials-plugin

Provides Jenkins with extension points to securely store, manage, and bind credentials data to other Jenkins plugins, builds, pipelines, etc.
Java
107
star
88

jira-steps-plugin

Jenkins pipeline steps for integration with JIRA.
Java
104
star
89

artifactory-plugin

Jenkins artifactory plugin
Java
104
star
90

build-flow-plugin

A plugin to manage job orchestration
Groovy
103
star
91

throttle-concurrent-builds-plugin

Java
101
star
92

github-oauth-plugin

Jenkins authentication plugin using GitHub OAuth as the source.
Java
99
star
93

pipeline-graph-view-plugin

Java
99
star
94

promoted-builds-plugin

Jenkins Promoted Builds Plugin
Java
96
star
95

ssh-slaves-plugin

SSH Build Agents Plugin for Jenkins
Java
96
star
96

github-pr-coverage-status-plugin

Nice test coverage icon for your pull requests just from Jenkins
Java
93
star
97

jenkins-test-harness

Unit test framework for Jenkins core and its plugins
Java
92
star
98

opentelemetry-plugin

Monitor and observe Jenkins with OpenTelemetry.
Java
90
star
99

localization-zh-cn-plugin

Chinese Localization for Jenkins
HTML
89
star
100

workflow-remote-loader-plugin

Load Pipeline scripts from remote locations (e.g. Git) - replaced by Pipeline: Groovy Libraries plugin
Java
88
star