Because of that I tried to use jacoco offline analysis.With that I was able to get the coverage results.
There after I found that when I write new test cases the Jacoco will not update the coverage. It is still keeping old coverage.
following is my maven configuration
<!-- Code coverage -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>default-instrument</id>
<goals>
<goal>instrument</goal>
</goals>
<configuration>
<skip>${jacoco.skip.instrument}</skip>
</excludes>
</configuration>
</execution>
<execution>
<id>default-restore-instrumented-classes</id>
<phase>pre-integration-test</phase>
<goals>
<goal>restore-instrumented-classes</goal>
</goals>
<configuration>
<skip>${jacoco.skip.instrument}</skip>
</configuration>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco.exe</dataFile>
<excludes>
<exclude>
</excludes>
</configuration>
</execution>
</executions>
Im using Powermock to mock some static methods for unit testing and I found that jacoco on-the-fly coverage analysis is not updated for mock unit tests.Because of that I tried to use jacoco offline analysis.With that I was able to get the coverage results.
There after I found that when I write new test cases the Jacoco will not update the coverage. It is still keeping old coverage.
In offline mode ... There are two different ways to provide the configuration:
Configuration File: ...
System Properties: ...