I have a huge code base configured using maven. My codebase is divided in different maven modules and thus I have a main pom file and each sub module has its own pom file. But still these modules call each other's functionality. Junit tests are written for each module. I am using Cobertura to generate code coverage. Its generating separate coverage report for each module. When Cobertura generate code coverage for module A and a perticular code from Module A is getting called by tests from module B. In this scenario Cobertura marks that code from Module A as uncovered. Is this the expected behavior? Or I have wrong configuration?
Maven - Cobertura Configuration in submodules:
build section:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${org.codehaus.mojo.cobertura-maven-plugin.version}</version>
</plugin>
Reporting section:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${org.codehaus.mojo.cobertura-maven-plugin.version}</version>
<configuration>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
Command to run Cobertura report:
mvn cobertura:cobertura