'sonarqube error: file can't be indexed twice
In the process of migrating migrating our company's build software from ant to gradle we have come across this error.
Execution failed for task ':sonarqube'.
File src/opendap/aggregation/AggregationParams.java can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
The interesting part of this error is that if we exclude the file throwing the error, it moves onto the next file listed, and if we exclude the entire directory it moves to the first file of the next directory.
Having followed the sonarqube docs and multiple other stackoverflow posts this is the current sonarqube config
sonarqube {
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectKey", "opendap-olfs"
property "sonar.projectName", "olfs"
property "sonar.projectVersion", "${OLFS_VERSION}"
property "sonar.organization", "opendap"
property "sonar.sources", "src"
property "sonar.exclusions", "src/opendap/Coverity_Model.java," +
"src/opendap/experiments/**/*.java," +
"src/opendap/metacat/**/*.java," +
"src/opendap/aws/**/*.java," +
"src/opendap/noaa_s3/**/*.java," +
"src/opendap/**/*Test.java"
property "sonar.java.binaries", "build"
property "sonar.java.libraries", "lib/*.jar"
}
}
and this is the build directory we are trying to scan
If anyone knows the cause of this please let us know what we are doing wrong.
Any and all help is appreciated
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

