Hi, I am having a hard time to get JaCoCo plugin working to get integration test (IT) coverage for my Spring boot app with Maven.
Here's my configuration for the jacoco-maven-plugin for IT:
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.itReportPath}</destFile>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${sonar.jacoco.itReportPath}</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
And we are using the spring-boot-maven-plugin for running the integration tests as below,
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.7.RELEASE</version>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<fork>false</fork>
<arguments>
<argument>--server.port=${flex.module.port}</argument>
<argument>--logging.config=${project.basedir}/src/test/resources/test-log4j.xml</argument>
<argument>--server.tomcat.accesslog.enabled=false</argument >
<argument>--server.tomcat.basedir=${project.build.directory}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
--- jacoco-maven-plugin:0.7.7.201606060606:report (post-integration-test) @ se-service ---
[INFO] Skipping JaCoCo execution due to missing execution data file.