SonarScanner for Gradle documentation incorrect

The SonarScanner for Gradle 3.0 documentation mentions in the defaults:

sonar.sources: ${sourceSets.main.allSource.srcDirs} (filtered to only include existing directories)

This is incorrect, looking at the source it is clear is uses sourceSets.main.allJava.srcDirs.

This is unfortunate and leads to warnings with Sonarqube 8.5, as src/main/resources is not included by default, missing Thymeleaf templates.

2 Likes

Thanks for letting us know. It will be fixed in the docs for v8.6.

1 Like

I would suggest not to fix the docs, but to fix the scanner. It is probably preferable to feed all sources to Sonar, and not just the Java sources (as you will be missing templates, Groovy, Scala, Kotlin files, et cetera).