Coverage of co-operating module?

32 views
Skip to first unread message

David Karlsen

unread,
Oct 28, 2018, 2:37:51 PM10/28/18
to JaCoCo and EclEmma Users
I have a multi-module maven-project - among other modules, there is:
- service
- dao
- model

My tests are in service, and the services uses model and dao - but coverage is only measured for service? Is there any way to work around this?

Evgeny Mandrikov

unread,
Oct 28, 2018, 6:36:56 PM10/28/18
to JaCoCo and EclEmma Users

David Karlsen

unread,
Oct 31, 2018, 7:16:47 AM10/31/18
to JaCoCo and EclEmma Users
That works for generating a jacoco html-report.
I however need the merged .exec files for sonar - so that I can see the coverage in sonar.

I also tried:

<profiles>
<profile>
<id>jacocoreport</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<goals>
<goal>merge</goal>
</goals>
</execution>
</executions>
<configuration>
<fileSets>
<fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
<directory>${project.build.directory}</directory>
<includes>
<include>**/target/*.exec</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</plugin>
</plugins>
</build>
</profile>

But that ends in:

[DEBUG] Configuring mojo 'org.jacoco:jacoco-maven-plugin:0.8.2:merge' with basic configurator -->

[DEBUG]   (f) destFile = /Users/et2448/projects/tac/jfr/tac-jfr-server/target/jacoco.exec

[DEBUG]   (s) directory = /Users/et2448/projects/tac/jfr/tac-jfr-server/target

[DEBUG]   (s) includes = [**/target/*.exec]

[DEBUG]   (f) fileSets = [org.apache.maven.shared.model.fileset.FileSet@5de4ac96]

[DEBUG]   (f) project = MavenProject: com.edb.fs.tac.jfr.srv:jfr-srv:6.1.2-SNAPSHOT @ /Users/et2448/projects/tac/jfr/tac-jfr-server/pom.xml

[DEBUG]   (f) skip = false

[DEBUG] -- end configuration --

[INFO] Skipping JaCoCo merge execution due to missing execution data files

Evgeny Mandrikov

unread,
Oct 31, 2018, 7:40:41 AM10/31/18
to JaCoCo and EclEmma Users


On Wednesday, October 31, 2018 at 12:16:47 PM UTC+1, David Karlsen wrote:
That works for generating a jacoco html-report.
I however need the merged .exec files for sonar - so that I can see the coverage in sonar.

You don't need merged exec file for SonarQube - please see https://community.sonarsource.com/t/coverage-across-modules/3766

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages