Back to directory
sbt avatar

sbt-jacoco

an sbt plugin for JaCoCo Code Coverage. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/sbt/sbt-jacoco.git

123

Stars

67

Forks

11

Watchers

EPL-1.0

License

sbt-jacoco - Code Coverage via JaCoCo in sbt

Build Status Release Status SBT 1.0 version

This is an sbt plugin for code coverage analysis via JaCoCo. Supports uploading results to Coveralls, Codecov and Codacy.

Install the plugin by adding the following to project/plugins.sbt:

addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "<version>")

And then execute the plugin with sbt jacoco. This will instrument and run the unit tests and output the coverage metrics:

[info] ------- Jacoco Coverage Report --------
[info]
[info] Lines: 66.67% (>= required 0.0%) covered, 2 of 6 missed, OK
[info] Instructions: 83.54% (>= required 0.0%) covered, 13 of 79 missed, OK
[info] Branches: 0% (>= required 0.0%) covered, 0 of 0 missed, OK
[info] Methods: 57.14% (>= required 0.0%) covered, 3 of 7 missed, OK
[info] Complexity: 57.14% (>= required 0.0%) covered, 3 of 7 missed, OK
[info] Class: 50% (>= required 0.0%) covered, 2 of 4 missed, OK
[info]
[info] Check /home/example/jacoco-test/target/scala-2.11/jacoco/report for detailed report

A detailed HTML report will also be generated in the directory shown that includes line level details of coverage.

See the docs for details on configuration options.

Releases

Apr 3, 2026

3.6.0

Download .zip

sbt 2.x migration

Cross build to sbt 2 by @xuwei-k in #389 Delete sbt 0.13 cross build files by @xuwei-k in #360 Prepare sbt 2 build by @xuwei-k in #388

other updates

deps: Update org.jacoco.core,...

Mar 12, 2024

3.5.0

Download .zip

updates

Update org.jacoco.core, org.jacoco.report to 0.8.11 by @scala-steward in #287 Update commons-codec to 1.16.0 by @scala-steward in #272 Update jackson-core to 2.16.1 by @scala-steward in #295...

Oct 28, 2021

3.4.0

Download .zip

v3.3.0...v3.4.0

Upgrades underlying JaCoCo to 0.8.7 for JDK 17 support #139 by Gökhan Öner (@gokhanoner) Various upgrades thanks to @scala-steward Updates release to sbt-ci-release #167 by @gokhanone...

Nov 13, 2020

3.3.0

Download .zip

Updates to JaCoCo 0.8.6 #133 by @gzoller Adds Codacy as a compatible coverage service #127 by @franciscodua Fixes Method code too large! by adding jacocoInstrumentationIncludes and jacocoInstrumentati...

Nov 12, 2020

3.2.0

Download .zip

v3.1.0...v3.2.0

Updates to JaCoCo 0.8.2 #119 by @iadcode