0

I have a maven project which is using in jacoco plugin for generating in test coverage reports. The plugin is configured as :

 <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco-maven-plugin.version}</version>
            <executions>
                <execution>
                    <id>report-aggregate</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report-aggregate</goal>
                    </goals>
                    <configuration>
                    </configuration>
                </execution>
                <!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven
                    the Surefire plugin is executed. -->
                <execution>
                    <id>jacoco-initialize-unit-test</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <destFile>${project.build.directory}/../../target/coverage-reports/jacoco-ut.exec</destFile>
                        <append>true</append>
                        <propertyName>jacoco.agent.argLine</propertyName>
                    </configuration>
                </execution>
                <execution>
                    <id>jacoco-initialize-integration-test</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <destFile>${project.build.directory}/../../target/coverage-reports/jacoco-it.exec</destFile>
                        <append>true</append>
                        <propertyName>jacoco.agent.argLine</propertyName>
                    </configuration>
                </execution>
                <execution>
                    <id>jacoco-merge</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>merge</goal>
                    </goals>
                    <configuration>
                        <fileSets>
                            <fileset>
                                <directory>${project.build.directory}/../../target/coverage-reports/</directory>
                                <includes>
                                    <include>*.exec</include>
                                </includes>
                            </fileset>
                        </fileSets>
                        <destFile>${project.build.directory}/../../target/coverage-reports/jacoco.exec</destFile>
                    </configuration>
                </execution>

The problem here is when i run command mvn test It is generating the exec report but not generating the xml report and need in to generate the xml report.

Any suggestions

Scientist
  • 1,458
  • 2
  • 15
  • 31
  • Can you please show the full pom file also the output during the test... why have you configured propertyName for argLine etc.? Which version of jacoco do you use? Which Maven version/JDK version? – khmarbaise Jul 13 '22 at 08:15
  • Is this a multi module build? – khmarbaise Jul 13 '22 at 08:43

0 Answers0