I am trying to generate a code coverage report for our multi-module maven project using cobertura. After running mvn clean and then running the mvn package. Then, in one of the modules where we run the JUnit tests, the coverage report generated for this module is correct as expected. But coverage only covers a few packages. Not all packages are covered. Remember that this is a multi-module project with one parent POM and each child module having its own POM. Should I also include the details of the cobertura maven plugin in each of these child POMs?
However, the individual coverage report of a particular module, generated in other directories / target / site / cobertura, is reported as zero both for line coverage and for branch coverage.
Am I missing something in my parent POM ?, I did not make any changes to any of the child POMs in the directories. please let me know how to create a code coverage report for a project with several maven modules using coberture.
This is what my parent POM looks like.
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> <inherited>true</inherited> <executions> <execution> <phase>package</phase> <goals> <goal>cobertura</goal> </goals> </execution> </executions> </plugin>
...
<dependencies> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> <type>plugin</type> <scope>package</scope> </dependency> </dependencies>
Thanks!
user1492680
source share