Questions tagged [jacoco]

JaCoCo a coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

JaCoCo is an EPL-licensed, open-source code coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

Compared to Cobertura, it has lower runtime overhead but less precision. It is unable to record hit counts, it only records red/green, however it can show coverage on class, method, line, complexity, branch and instruction level. It also has the ability to merge the results of multiple analyses when generating a report.

QuickLinks:

Related Tags:

JaCoCo is the successor of the EclEmma Eclipse plugin for the Emma coverage tool. If a search through -tagged questions doesn't help, try searching for the tag.

The tag is used for general topics related to code coverage measurement.

1891 questions
20
votes
1 answer

Reporting and Merging multi-module jacoco reports with report-aggregate

Attempting to get one jacoco report that will show all the results from multiple modules. I am able to see that each of the sub-modules have a jacoco.exec after building the project but unsure of how to get it to output one report that will have all…
kingz415
  • 301
  • 1
  • 2
  • 3
20
votes
4 answers

No coverage in 'all classes in scope' in Intellij

In Intellij IDEA 14.1.5 Community edition, I imported maven to get coverage from jacoco.exec file. Steps followed right click on imported module. select Analyze-->Show Converage Data. provided valid jacoc.exec file and click 'show…
fahad
  • 2,999
  • 3
  • 17
  • 20
20
votes
2 answers

Trouble configuring JaCoCo in maven

I am trying to do a simple JaCoCo report through Maven and I keep getting the same error. Here is a snippet of my plugin. org.jacoco jacoco-maven-plugin
Dubius
  • 428
  • 1
  • 5
  • 11
20
votes
9 answers

SonarQube on Java8-project gives jacoco-Exception

I just downloaded the latest version, SonarQube 4.3, then try build a java-8 project with: mvn clean install mvn sonar:sonar That gives me the Exception below. Googling, I got the impression this is an earlier issue that should have been…
Rop
  • 3,359
  • 3
  • 38
  • 59
19
votes
7 answers

Jacoco code coverage 0% in Android-kotlin project

I have been trying to implement Jacoco for code coverage in Android kotlin project. I used deafult android studio coverage tool but it was not reliable. So I tried to implement Jacoco but I am getting 0% code coverage even after tests are passing…
riskPlayGround
  • 422
  • 5
  • 16
19
votes
2 answers

Gradle task jacoco report generate empty html report file (No class files specified)

I would like to use Jacoco to generate a code coverage report on all my tests (androidTest + UnitTest). So I implemented a step-by-step script (jacoco.gradle) to create a task that allowed me to generate a report that merged two code coverage…
Dev Loots
  • 708
  • 9
  • 28
19
votes
2 answers

How to ignore inner/nested classes with JaCoCo?

I'm trying to ignore some generated classes, and the classes get ignored fine. But if those classes have inner classes, those classes still get included, despite the parent class being excluded. This is my configuration:
Torque
  • 3,319
  • 2
  • 27
  • 39
19
votes
1 answer

what does jacoco yellow line mean

I am trying to measure my code coverage using jacoco, but I dont understand the meaning of the yellow lines. The document says that it is for a condition which is not fully covered. But see the coverage snapshot I got - it is evident that the…
R71
  • 4,283
  • 7
  • 32
  • 60
19
votes
2 answers

What are the differences between the three methods of code coverage analysis?

This sonar page basically lists the various methods employed by different code coverage analysis tools: Source code instrumentation(Used by Clover) Offline byte code instrumentation(Used by Cobertura) On-the-fly byte code instrumentation(Used by…
Geek
  • 26,489
  • 43
  • 149
  • 227
19
votes
5 answers

Jacoco Maven Plugin - Plugin execution not covered by lifecycle configuration

I'm new to Maven and want to use the Jacoco Maven Plugin to build my projects. I've set up an example project with TestNG the only dependency. Here is part of the pom.xml: org.testng
Markus
  • 245
  • 1
  • 2
  • 9
18
votes
4 answers

An error has occured in JaCoCo report generation

I'm currently trying to add JaCoCo as a dependency on my spring boot maven project to see the code coverage for my unit tests. However, when I run the tests, it fails with error. Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:report…
John
  • 243
  • 2
  • 4
  • 9
18
votes
2 answers

Global code coverage in multi-module Android project: merge code coverage reports (Unit & UI tests)

I have an Android app which is made up of 2 modules: App - UI Submodule - has most of the business logic For each of them I have a gradle task to validate code coverage: App: UI Code coverage (Espresso) Submodule: Unit tests code coverage As a…
Renato Almeida
  • 369
  • 4
  • 14
18
votes
1 answer

Jacoco code coverage in Android Studio with flavors

I've been trying to run Jacoco test coverage for quiet some time now. I've tried several possible solutions reported in these topics: Android test code coverage with JaCoCo Gradle plugin How do I get a jacoco coverage report using Android gradle…
Adr3nl
  • 453
  • 2
  • 5
  • 19
18
votes
3 answers

Exclude Setters and Getters in JaCoCo Code Coverage

With the cobertura-maven-plugin setters and getters can be excluded from code coverage using the ignoreTrivial option. Is there also such a possibility with the jacoco-maven-plugin? This is my current configuration:
Benny Code
  • 51,456
  • 28
  • 233
  • 198
18
votes
2 answers

How can I get code coverage of an external java library with jacoco?

If I have a java project that uses a library (a jar file), is it possible to get the code coverage of classes inside this jar ? The idea behind this is that I would like to find out what proportion of the external libraries the project relies on…
Guillaume
  • 181
  • 1
  • 1
  • 6