Since we run SonarQube in Docker, I was able to reproduce the problem locally. And then I spent quite some time trying to figure out which combination of plugins produced the error, by only using SonarJava and one of the other plugins, but it never happened until I added all the plugins back. So I tried the other way around, only removing one plugin from our set, but the error never happened either!
So I have an environment reproducing the problem, but it only happens with our exact set of plugins! Next, I’m going to try and create a project as simple as possible to reproduce the problem and push it to GitHub. Had I known I would not reproduce the error in any modified environment, I would have done that first, because the project I tested with takes a bit more than 2 minutes to build…
For the record, I tried the build with
-verbose:class, and only got
[0.719s][info][class,load] com.google.common.base.Preconditions source: file:/Users/fpavageau/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv/gradle-4.10.2/lib/guava-jdk5-17.0.jar
[15.963s][info][class,load ] com.google.common.base.Preconditions source: file:/Users/fpavageau/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/26.0-jre/6a806eff209f36f635f943e16d97491f00f6bfab/guava-26.0-jre.jar
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
The first match seems to be the Gradle Wrapper, and the second one is our integration tests, running in a forked JVM.