SonarScanner gradle plugin - build.gradle not indexed by default

build.gradle is a groovy file, so you may use groovy plugin.

See Does sonarqube support scanning groovy language?.

Note: sonar-groovy is not maintained anymore, but one of the forks seems to be updated to work with 10.6 (from reading the commit name, I haven’t tested it myself).

You’ll have to add .gradle to groovy suffixes: sonar-groovy/sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/foundation/Groovy.java at main · Inform-Software/sonar-groovy · GitHub

Of course, there are no gradle-specific rules. It seems that noone has written them…

Jano

1 Like