1
votes

We recently upgraded our gradle to version 2.13 (the latest at the time of this writing). We are using the sonarqube plugin calling it via "gradlew clean test sonarqube". Before the upgrade, everything was working fine with Sonar.

After we upgraded to version 2.13, we get the following error "Incompatible version 1007" and it looks like an incompatibility with the gradle jacoco plugin. We are currently using version 2.0.1 of the sonarqube plugin and we also tried the sonarRunner plugin as well which fails with the same error. Has anybody else run into this and how did you resolve it?

plugins {
  id "org.sonarqube" version "2.0.1"
}


4:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarqube'.
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] > Unable to read /var/lib/jenkins/jobs/Indicee-BI-API-Java-Library_platform_team/workspace/build/jacoco/test.exec
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] 
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.

14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Incompatible version 1007.
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter]    at org.sonar.plugins.jacoco.JaCoCoOverallSensor.loadSourceFiles(JaCoCoOverallSensor.java:124)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter]    ... 95 more
1
Which version of JaCoCo is used to produce the report and which version of the sonarqube java plugin is used ?benzonico
In our gradle file, we never specified the jacoco plugin version so it is the default that comes with version 2.13 of gradle. The sonarqube plugin version is above version 2.0.1, the latest at the time of this writing.kevinc
The only plugin version we explicitly specify is the sonarqube plugin.kevinc
The following are all the plugins that we incorporate: apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'maven' apply plugin: 'findbugs' apply plugin: 'jacoco' apply plugin: "org.sonarqube"kevinc
FYI, gradle version 2.13 explicitly specified a breaking change from jacoco (docs.gradle.org/current/…). There is a workaround but we've upgraded our Jenkins environments to the latest Jacoco plugin already to account for this so the workaround won't help. We didn't find out about the Sonar problems until later as they are a separate build step.kevinc

1 Answers

1
votes

The Sonar plugin upgrade for Java to 3.13.1 worked. Thank you.