Gradle plugin Regression: "File application/build.gradle.kts can't be indexed twice"

After updating the SonarQube Gradle plugin from to our project analysis starts to fail:

Execution failed for task ‘:sonar’.

179> File application/build.gradle.kts can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

Our setup:

  • SonarQube 9.9.1, Enterprise Edition.
  • Relevant sonar properties (note: this is per module):
            property("sonar.exclusions", "**/BuildConfig.class,**/,**/R\$*.java,src/main/gen/**/*")
            property("sonar.sources", "src/main,build.gradle.kts")
            property("sonar.tests", "src/test")
            property("sonar.coverage.exclusions", "build.gradle.kts")

Is this a known issue?

Hey there.

Yes this is a known issue.

In the meantime you can revert to v4.0 or the latest version without this issue, v4.2.1


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.