Exes files are not generated. My profile for mvn sonar:sonar -Psonar-coverage I also read this thread. didn't help me jacoco's prepare-agent not generating jacoco.exec file
<profile>
<id>sonar-coverage</id>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://nexus-url.ru/nexus/content/repositories/central/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${basedir}/target/coverage-reports/jacoco-ut.exec</destFile>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${basedir}/target/coverage-reports/jacoco-ut.exec</dataFile>
<outputDirectory>${basedir}/target/jacoco-ut-report</outputDirectory>
</configuration>
</execution>
<execution>
<id>pre-integration-test</id>
<phase>package</phase>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<destFile>${basedir}/target/coverage-reports/jacoco-it.exec</destFile>
<propertyName>integrationTestArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<phase>verify</phase>
<goals>
<goal>report-integration</goal>
</goals>
<configuration>
<dataFile>${basedir}/target/coverage-reports/jacoco-it.exec</dataFile>
<outputDirectory>${basedir}/target/jacoco-it-report</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
In logs: "Skipping JaCoCo execution due to missing execution data file." My build:
mvn clean install -Psonar-coverage
but, in logs:
[INFO] --- jacoco-maven-plugin:0.8.0:prepare-agent (pre-unit-test) @ pos-parent ---
[INFO] argLine set to -javaagent:/pos/.m2/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/pos/pos/target/coverage-reports/jacoco-ut.exec
[INFO]
[INFO] <<< maven-source-plugin:2.1.2:jar (attach-sources) < generate-sources @ pos-parent <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:2.1.2:jar (attach-sources) @ pos-parent ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.0:prepare-agent-integration (pre-integration-test) @ pos-parent ---
[INFO] integrationTestArgLine set to -javaagent:/pos/.m2/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/pos/pos/target/coverage-reports/jacoco-it.exec
[INFO]
[INFO] --- maven-scm-validator-plugin:1.0.2:validate (default) @ pos-parent ---
[WARNING] Project's dir probably isn't local copy of SVN repository. SCM settings validation will be skipped.
[INFO]
[INFO] --- maven-dependency-conflicts-plugin:1.0:analyze (default) @ pos-parent ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.0:report-integration (post-integration-test) @ pos-parent ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
what's my mistake? please help