Le vendredi 8 avril 2016 19:53:55 UTC+2, [email protected] a écrit :
> Hi ,
> 
> I have a multimodule project. where i have configured jacoco for unit tests.
> 
> main
> ---module-a
> ---module-b
> 
> I have configured jacoco maven plugin in parent pom.xml
> 
> <plugin>
>       <groupId>org.jacoco</groupId>
>       <artifactId>jacoco-maven-plugin</artifactId>
>       <version>${jacoco.version}</version>
>       <executions>
>               <execution>
>                       <goals>
>                               <goal>prepare-agent</goal>
>                       </goals>
>               </execution>
>               <execution>
>                       <id>report</id>
>                       <phase>prepare-package</phase>
>                       <goals>
>                               <goal>report</goal>
> 
>                       </goals>
>               </execution>
>       </executions>
> </plugin>
> 
> 
> when i run mvn clean install it runs unit tests and generates .exec in each 
> of the module. But how do i get a merged/aggregated code coverage report of 
> the 2 modules ?
> 
> where should configure the merge goal of jacoco , in the parent pom or 
> individual POM ?
> can some body tell me how to configure the jacoco for merged report? 
> what configurations to set and how to run it ?
> 
> Thanks!
> Raj

I have a working but ugly solution. The trick here is to use the Maven 
undocumented parameter "${session.executionRootDirectory}" to set the jacoco 
destFile attribute. This works pretty well, and with it, I can have only one 
data file shared with every modules in a multi module project, no matter how 
much modules you have or how deep they are nested. 

Additionnaly, that parameter is not recognized by sonar-maven-plugin, but I 
have another hack to make it works with Sonar too (ask me if you need it)

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/4bdbbcac-d07a-4ffc-901d-b1643ba6ff11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to