SonarScanner for Gradle: you can now decide when to compile

Another option is to configure it in gradle.properties like so:

systemProp.sonar.gradle.skipCompile=true