Must-share information (formatted with Markdown):
I m using sonarqube-gradle-plugin:3.3 version and trying to scan a Java project through GitHub Action. I have set the sources and tests file but I encountered the issue regarding some files cannot be indexed twice.
The structure of my java project is:
├── api-model
│ └── src
│ ├── main
│ │ ├── java
│ │ └── pegasus
│ └── test
│ └── java
├── client
│ └── src
│ ├── main
│ │ └── java
│ └── test
│ ├── java
│ └── resources
├── client-tools
│ ├── binding-generator
│ │ └── src
│ │ ├── main
│ │ └── test
│ ├── client-generator
│ │ └── src
│ │ ├── main
│ │ └── test
│ └── query-builder
│ └── src
│ ├── main
│ └── test
├── datafetcher-generator
│ └── src
│ ├── main
│ │ ├── java
│ │ └── resources
│ └── test
│ ├── java
│ └── resources
Here’re the things I have tried:
- I tried to NOT specify sources and tests in the gradle setting and just let the gradle plugin to auto detect that according Narrowing the focus with analysis scope. It could be auto detected and what I got is graphql-infra/graphql-infra/api-model/src/test/java/com/graphql/api/GraphQLResponseUtilTest.java can’t be indexed twice.
- I also tried to just set
sources=datafetcher-generator/src/main/java
tests=datafetcher-generator/src/test/java
but it also complains raphql-infra/graphql-infra/api-model/src/test/java/com/graphql/api/GraphQLResponseUtilTest.java can’t be indexed twice. It’s weird since I don’t even include that in the sources. - I tried the wild card which is to set
sources=/src/main/java
tests=/src/test/java.
It complains graphql-infra/graphql-infra/api-model/src/test/java/com/graphql/api/GraphQLResponseUtilTest.java can’t be indexed twice. - I tried to use inclusion and exclusion.
Seems like nothing works. And it felt weird that the scanner doesn’t seem to pick up my settings. Could anyone please help?