Hi All,
I have a requirement to Skip the Jacoco execution by default and have to execute the same on demand by overriding -Djacoco.skip=false in Jenkins build.
I have this in my base-pom. which is working fine by default.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration combine.self="override">
<skip>true</skip>
<destFile>${project.build.directory}/jacoco.exec</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration combine.self="override">
<skip>true</skip>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
overriding the same in mvn install -Djacoco.skip=false , but getting this message.
[INFO] Skipping JaCoCo execution because property jacoco.skip is set.
[INFO] surefireArgLine set to empty