I ran into a bug that is starting to really annoy.
Here is what I have: 1) Sonar 3.5, which uses JaCoCo as a coverage tool. 2) Jmockit lib for testing using mocks. 3) The build process automated with maven.
So, when I run mvn clean install , which is fine, and then I run mvn sonar:sonar and what happens here:
- Jmockit seems to be the instrumental classes that it needs.
- JaCoCo cannot host tool classes that are already instrumented by Jmockit and spits out a HUGE amount of exceptions, saying that this is not possible for a tool class that has already been instrumented. However, it seems that Sonar has a valid result for such a scenario.
So the first question is: can I somehow suppress such exceptions? This is really important because the size of the log file in our CI system reaches 50Mb (!), Which is unacceptable. A lot of free space is simply eaten up by such magazines on our CI machine.
Here are the exceptions I have:
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class app/MyClass. Caused by: java.lang.IllegalStateException: Class app/MyClass is already instrumented.
Assuming that it is impossible to exclude such exceptions, I studied it a bit and found out that JaCoCo (a tool that uses Sonar and a tool that cannot have tools with tool classes) has a mode such as offline instrumentation (AFAIK Sonar does not support this offline instrumentation or may suppress such warnings). This item is intended to be used specifically for such cases. So I tried to configure JaCoCo as a plugin in maven, but I was not able to do this. JaCoCo cannot find the execution file. When I run mvn clean install , the following message appears:
[INFO] --- jacoco-maven-plugin: 0.6.2.201302030002: report (report) @ webservice-mws --- [INFO] JaCoCo execution skip due to missing execution data file
If I am not mistaken, this executable is the RESULT of the JaCoCo plugin. I am completely upset and do not know what to do with it.
If someone can help me, it will be very appreciated! Thanks in advance!
my pom.xml settings for the JaCoCo plugin:
<plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.6.2.201302030002</version> <executions> <execution> <phase>process-test-resources</phase> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>report</id> <phase>verify</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin>
source share