Now: SonarQube 8.0
Was: SonarQube 6.4
Java: All code compiling using Java 8
Error: SonarScanner will require Java 11+ to run starting in SonarQube 8.x
Question: How do I pass Java 11 location to SonarQube on the Gradle command line and not modify JAVA_HOME. i.e. is there a (sonar.) property available for this…?
Did you have any luck with this? I’m running into a similar issue working with a project in Java 7 while Sonar is looking for Java 8. Is it possible to provide the path for Java 8 in the gradle.properties or build.gradle files?
I tried to run the build with JDK8 first and separately run the task sonarqube with JDK11. But unfortunately then gradle wants to recompile.
And our source is not compaitble with JDK11 yet (depending on tools.jar).
Does any working solution for Java 8 code exist with gradle yet?
the following procedure (changing the JAVA_HOME to jdk11 in between the “clean build” and the “sonarqube” tasks) does not work for you as gradle tries to recompile in the sonarsource task?
I soon, too, need to find a way to combine jdk8 and jdk11 with gradle. So if this doesn’t work i will also be bitten … interesting
sonar to work correctly (because it needs Java 11)
me to put off upgrading my main app to Java 11 for now
With the newer version of Sonar, I also had to set a few other properties (see this guide):
jacoco {
// We need to use a newer version of jacoco to be compatible with the Java 11+ JDK that's required for the SonarQube Analysis
toolVersion = '0.8.8'
}
jacocoTestReport {
// The newer version of SonarQube uses the xml report instead of the previously used exec report.
reports {
xml.enabled true
}
}
plugins.withType(JacocoPlugin) {
// This ensures that the jacocoTestReport task runs after the test tasks; the sonar analysis needs the test report.
tasks['test'].finalizedBy 'jacocoTestReport'
}