Issue with Powermock using jacoco code coverage

2,171 views
Skip to first unread message

ghr...@gmail.com

unread,
Oct 26, 2015, 10:25:59 AM10/26/15
to JaCoCo and EclEmma Users
Hi ,

I am getting an error is already instrumented while using jacoco code coverage using maven. My project is maven project.It has maven dependencies powermock, mockitto and jacoco plugin.
I believe it is causing error "default-restore-instrumented-classes". If I remove this it is not generating jacoco coverage report.
When I run mvn clenn install, the build is working fine and generating jacoco coverage report. But in console it is generating huge exceptions already instrumented

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>

<execution>
<id>default-instrument</id>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>default-restore-instrumented-classes</id>
<goals>
<goal>restore-instrumented-classes</goal>
</goals>
</execution>

</executions>
</plugin>
</plugins>

Marc R. Hoffmann

unread,
Oct 26, 2015, 5:24:23 PM10/26/15
to jac...@googlegroups.com
Hi,

you cannot combine offline instrumentation with the JaCoCo agent. This
results in classes getting instrumented twice. See documentation

http://eclemma.org/jacoco/trunk/doc/offline.html

and our example project here:

http://eclemma.org/jacoco/trunk/doc/examples/build/pom-offline.xml

Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages