Here are the exceptions I've got:
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class app/MyClass.
Caused by: java.lang.IllegalStateException: Class app/MyClass is already instrumented.
Here is what I have:
1) Sonar 3.5 which uses JaCoCo as coverage tool.
2) Jmockit lib to perform testing with use of mocks.
3) Build process automized with maven.
50Mb
(!), which is not acceptable. A lot of free space is just eaten up by such a logs on our CI machine.
Here are the exceptions I've got:
|
offline instrumentation
(AFAIK Sonar neither support this
offline instrumentation
or can suppress such a warnings). This thing is designed to be used exactly for such a cases. So I tried to set up JaCoCo as a plugin in maven, but I failed to do this cause JaCoCo can't find some execution file. When I'm running
mvn clean install
the following error pops up:
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:report (report) @ webservice-mws ---
[INFO] Skipping JaCoCo execution due to missing execution data file
解决方法:
在jacoco 中添加:
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>com.cloud.generated.*</exclude>
</excludes>
<skip>${jacoco.skip.instrument}</skip>
</configuration>
<executions>
<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>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>