3

We are using JaCoCo for unit test code coverage in our multi-module maven project and able to get the coverage info(jacoco.exec) for most of the modules where unit tests are available. The only issue that i'm seeing is, jacoco.exec is not getting generated for some of the classes in few modules even though unit tests are available (note that surefire-reports are generated).

Able to get coverage info for the same unit tests when used Cobertura.

The following is the parent pom.xml where I've added jacoco-maven-plugin info. Please help if there are any issues with pom.xml.


    <modules>
        <module>module1</module>
        <module>module2</module>        
        <module>module3</module>
        <module>module4</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.8</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>argLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>                     
                        <argLine>@{argLine} -Xmx500m -XX:MaxPermSize=256m</argLine>                                     
                </configuration>
            </plugin>

        </plugins>
    </build>

Thanks in advance!!

David
  • 31
  • 3

0 Answers0