We have JaCoCo working in our POM and it runs and reports every time we run clean install
.
What we would really like to do is only run JaCoCo when a maven site
is run.
I have tried adding:
...
<configuration>
<skip>${jacoco.skip}</skip>
....
And setting jacoco.skip
to true
for the build phase, but in the reporting section, I have added:
...
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<configuration>
<skip>false</skip>
<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
...
But this does not work. Setting jacoco.skip
to true
does prevent JaCoCo running on normal maven clean install's but also appears to affect the reporting.
Question: How would I configure maven so that JaCoCo runs successfully for a maven site, but does not run for a mvn clean install
?