Any alternative proposal for Multi-Module analysis properties removed in Sonarqube 7.6

Problems
In Sonarqube 7.6, Multi-Module analysis properties removed, that means we cannot use “sonar.modules” in our sonar property files. So Is there any alternative proposal for this?

The content in the property file before Sonarqube 7.6

  • our project folder
project
|——folder1
     |——src
	 |——main
	 |——test
|——folder2
     |——src
	 |——main
	 |——test
|——folder3
|——folder4
...
  • the content in our property files before Sonarqube 7.6
sonar.jacoco.reportPaths=/target/coverage-reports/jacoco-ut.exec
sonar.junit.reportPaths=/target/surefire-reports,/target/failsafe-reports
sonar.java.binaries=target

sonar.modules=folder1, folder2, folder3, folder4
folder1.sonar.projectBaseDir=/project/folder1
folder1.sonar.sources=src
folder2.sonar.projectBaseDir=/project/folder2
folder2.sonar.sources=src
...

we try the project level properties like this

sonar.projectBaseDir=/project
sonar.sources=/folder1/src, /folder2/src
sonar.jacoco.reportPaths=/folder1/target/surefire-reports,/folder1/target/failsafe-reports,/folder2/target/surefire-reports,/folder2/target/failsafe-reports
sonar.junit.reportPaths=/folder1/target/coverage-reports/jacoco-ut.exec,/folder2/target/coverage-reports/jacoco-ut.exec
sonar.java.binaries=/folder1/target,/folder2/target

For the properties above, it will get error if it contains same java name in different folders for the same project. same issue in stackoverFlow, it contains two solutions for this issue, it cannot help for me, because we still want to includes all those of the same name java file(they are different code), and cannot rename the file name also.

Any solution?
so could anyone help on this? if you have any advice, please let me know and check, much thanks!

Hi,

What’s your build technology? If you’re using Maven, then just do a Maven analysis (mvn sonar:sonar) and it will all, still just work.

 
Ann

Hi Ann,

Thanks for your kindly reply! I still have my question and need your help.

Yes, we are using Maven and I want to clear my question: how to configure the sonar properties file if no “sonar.modules” in the latest Sonarqube version 7.6?
Because we are using “sonar.modules” in our sonar properties file, if no “sonar.modules” properties, how can we update properties and let it still work? We had tried to configure multiple folders from different modules in a project to “sonar.sources”, eg: sonar.sources=/folder1/src, /folder2/src, but unfortunately it failed because JACOCO can’t add different class with same name.

We can config sonar properties in pom.xml, but many project in our side use sonar properties file, so may I know how can we update the sonar properties file if no “sonar.modules”?

Expect for your reply. thanks.

Hi. You can use the sonar.modules property in SonarQube 7.6 without any changes.

From the upgrade notes: “For the most part (see below) analysis of multi-module projects will continue to work as it has.”

It just won’t be reflected as a module in SonarQube UI. Download SQ 7.6 and test it. :wink:

1 Like

Hi Scott,

Thanks for your quickly reply! I still have two questions for this changing.

  1. The “sonar.modules” properties will not be deprecated in the further sonarqube version? What does “Multi-Module analysis properties removed” mean?

  2. Yes, I have tried to scan the project with “sonar.modules” properties which get the following warning, Do you know why get the following error?
    image

Expect for your reply, thanks.

Hi,

Those are warnings, not errors. They’re telling you that you ought to update how you specify duplications exclusions.

 
Ann

Hi Ann,
Noted. Thanks for your kindly reply!:slightly_smiling_face: