I am trying to use jacoco with maven. When I run mvn clean test I expect the coverage output to be written to target/coverage-reports however when I open up index.html after the build it's empty.
I checked the following, - The jacoco.exec file is present and it has a bunch of class names in it - In the coverage html there is a link 'Sessions' when I click on it I see a bunch if my classes that seem to have been executed - I see no errors or warnings when I run the maven command
I'm puzzled as to why the report is empty. From all the examples I have seen it seems like this should work. What am I missing?
I am using the following jacoco configuration for the maven plugin
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<append>true</append>
<skip>false</skip>
<excludes/>
<outputDirectory>${project.build.directory}/coverage-reports/</outputDirectory>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<includes>
<include>mypackage.*</include>
</includes>
<check>false</check>
</configuration>
<executions>
<execution>
<id>pre-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-test</id>
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
UPDATE
Apparently this has something to do with the includes pattern that I have provided. When I remove the includes it does show me coverage but for more than I need. I'm still trying to figure out the pattern to use to do a proper include.