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.

1633 questions
153
votes
18 answers

Getting "Skipping JaCoCo execution due to missing execution data file" upon executing JaCoCo

I'm using Maven 3.0.3, JUnit 4.8.1, and Jacoco 0.6.3.201306030806, and I am trying to create test coverage reports. I have a project with unit tests only, but I can't get reports to run, I'm repeatedly getting the error: Skipping JaCoCo execution…
Dave
  • 17,420
  • 96
  • 300
  • 582
144
votes
15 answers

Filter JaCoCo coverage reports with Gradle

Problem: I have a project with jacoco and I want to be able to filter certain classes and/or packages. Related Documentation: I have read the following documentation: Official jacoco site: http://www.eclemma.org/jacoco/index.html Official jacoco…
Jared Burrows
  • 50,718
  • 22
  • 143
  • 180
143
votes
13 answers

How to configure multi-module Maven + Sonar + JaCoCo to give merged coverage report?

I've searched up and down the internet for this one. There's lots of half-answers out there, to do with Maven properties such as ${sonar.jacoco.reportPath}, or org.jacoco:jacoco-maven-plugin:prepare-agent or setting maven-surefire-plugin argLine…
Stewart
  • 17,139
  • 8
  • 45
  • 74
119
votes
8 answers

Maven Jacoco Configuration - Exclude classes/packages from report not working

I have a maven multi-module project and I'm using jacoco-maven for code coverage reports. Some classes should not be reported, as they're Spring configuration and I'm not interested in them. I have declared the maven-jacoco plugin as…
resilva87
  • 2,955
  • 5
  • 29
  • 42
79
votes
8 answers

JaCoCo SonarQube incompatible version 1007

I'm using SonarQube for code quality control and suddenly builds that would otherwise pass can't be analyzed and fails. [INFO] [00:00:03.630] Analysing /mySuperProject/target/jacoco.exec -> java.io.IOException: Incompatible version 1007 When I…
Padvinder
  • 951
  • 1
  • 6
  • 9
79
votes
11 answers

how to use jacoco.exec report

I generated a code coverage report from jacoco, which is jacoco.exec. But I don't know how to use it ... The way I generated it is through command line: java -javaagent:/path/to/jacocoagent.jar=include=some.package.*,output=file…
wlhee
  • 1,798
  • 3
  • 16
  • 18
66
votes
8 answers

SonarQube not picking up Unit Test Coverage

I am having issues with sonar picking up the jacoco analysis report. Jenkins however is able to pick up the report and display the results. My project is a maven build, built by Jenkins. The jacoco report is generated by maven (configured in the…
anton91
  • 833
  • 2
  • 10
  • 12
64
votes
10 answers

Cannot use jacoco JVM args and surefire JVM args together in maven

I am using maven with the jacoco plugin to generate code coverage metrics. I am having some difficulty in configuring the surefire plugin with the java options required by the jacoco plugin. I've seen some answers about this already on Stack…
John Q Citizen
  • 2,788
  • 3
  • 24
  • 29
62
votes
6 answers

8 branches for try with resources - jacoco coverage possible?

I've got some code that uses try with resources and in jacoco it's coming up as only half covered. All the source code lines are green, but I get a little yellow symbol telling me that only 4 of 8 branches are covered. I'm having trouble figuring…
Gus
  • 6,132
  • 6
  • 32
  • 53
55
votes
7 answers

Testng, Emma, Cobertura, coverage and JDK 7 result in ClassFormatError and VerifyError

I have switched to the newest JDK 7 and I am having problems with running testng unit test on byte code that is fiddled by emma coverage tool. None of my test cases are run correctly and for most of them I am receiving such errors. …
Jagger
  • 9,590
  • 7
  • 42
  • 78
47
votes
5 answers

Jacoco coverage in Jenkins Pipeline

Can anyone suggest if there is a way to execute Jacoco in a Jenkins Pipeline? I have downloaded the plugin but I do not get the option for Jacoco in the 'Pipeline Syntax', which is the Pipeline script help . Referred this URL:…
user5917011
  • 1,037
  • 4
  • 13
  • 19
43
votes
1 answer

Jacoco with Gradle 0.10.0: Remote object doesn't exist

UPDATE Oct 21, 2014: The issue has been confirmed as fixed by using buildtools 21. UPDATE SEPT 18, 2014: The issue's status has been updated to FutureRelease. UPDATE: I have heard that this may not work with Dagger, and since Espresso uses Dagger,…
Maxwell
  • 5,475
  • 1
  • 30
  • 51
40
votes
9 answers

Jacoco and Unit Tests Code Coverage with android-gradle-plugin >= 1.1

I recently started integrating android-gradle-plugin 1.1.0 in one of my projects. The project uses robolectric 2.4 to run unit tests. It's a multi module project with very complex dependencies (Some modules depend on other modules). Something like…
Serj Lotutovici
  • 4,180
  • 4
  • 30
  • 41
40
votes
12 answers

Unable to get Jacoco to work with Powermockito using offline instrumentation

Given that Jacoco doesn't play nicely with PowerMockito when instrumenting "on the fly", I've been trying to configure offline instrumentation in the hope this will give me proper unit test coverage for classes that use PowerMockito. I've setup my…
MandyW
  • 1,087
  • 3
  • 13
  • 22
40
votes
5 answers

How do I get a jacoco coverage report using Android gradle plugin 0.10.0 or higher?

I'm trying to get a test coverage report using Gradle Android plugin 0.10.2. But I still can't get a coverage report after running some tests. (connectedAndroidTest). my main module's build.gradle is : apply plugin: 'android' android { …
Taeho Kim
  • 1,765
  • 2
  • 13
  • 16
1
2 3
99 100