After updating from 4.2.1.3168 → 4.3.0.3225 the sonar task fails with the following message:
File common/common-android/common-android.gradle.kts can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
We apply the sonar plugin to the root project and each subproject.
will add all subproject build script files to the root project file list and each submodule will add it’s own build script again? Maybe that is the issue?
I’m getting the same error, even though the SonarQube plugin is only applied to the root project:
Execution failed for task ‘:sonar’.
File sonar-zpa-plugin/build.gradle.kts can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
I’m having the same problem. I only have a root project and one module.
and I don’t have sonar.sources or sonar.tests set up.
File stream/amazon-image-remover/build.gradle.kts can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
According to the documentation, the default values for sonar.sources and sonar.tests are ${sourceSets.main.allJava.srcDirs}
However, when I tested it with the code below, the result was different
Could you please run the sonar command with this flag -Dsonar.scanner.dumpToFile= path/to/some/file And share the content of that file here? So I can investigate the issue.
Meanwhile, you can use the older version of the scanner or exclude the problematic file within sonar. exclusions property.