Sonar error in multi-language project: file cannot be indexed twice
I am trying to set up sonar to parse both java and javascript sources. I have a standard maven project. Following THIS I added the line
<properties>
<sonar.sources>src</sonar.sources>
</properties>
But when I run
mvn clean install sonar: sonar
I am getting the following error
[ERROR] Failed to execute target org.codehaus.mojo: sonar-maven-plugin: 2.5: sonar (default-cli) on project myproject: File [moduleKey = myproject: myproject, relative = SRC / test / Java / COM / MyProject /API/v1/ControllerTest.java, basedir = C: \ sources \ project] cannot be indexed twice. Check that the include / exclude patterns create disjoint sets for the main and test files → [Help 1]
"ControllerTest.java" is the first file in the /src/test/java/../ .. folder
Project structure:
Any hints? Thanks in advance for your help!
UPDATE
1 # Tried Akash Rajbanshi's suggestion: the error went away but the js code is not parsed and also sonar is not parse the test folder
2 # tried to put <sonar.language>js</sonar.language>
and the js code is actually parsed, but the java code is not (it was just a test)
I'm kind of stuck
source to share