问题
I have a multi-module gradle project created in android studio and want to run an analysis using sonarqube. The project structure is as below root (no source files) Module 1 com.myapp.module1 package1 package2
Module 2 (structure similar to that of Module 1)
I added the sonarqube plugin in the build.gradle file in root along with the following sonarqube properties: a) Host URL b) jdbc url c) Username for jdbc d) password for jdbc
I use gradlew for the build. When I run gradlew sonarqube from my root directory, sonarqube runs but indicates that 0 files are indexed for all the modules.
What am I missing here? It should be something fairly obvious but I have not been able to find an answer in the existing stackoverflow archives.
回答1:
I had to explicitly have sonar.sources property in each of the module.
sonarqube {
properties {
properties["sonar.sources"] += "src"
}
}
回答2:
you dont have to put sonar.sources in each module
Check my answer in this link,it worked for me:
What is the correct way to configure an Android project with submodules for use with the sonarqube gradle plugin?
来源:https://stackoverflow.com/questions/31460191/not-able-to-get-sonarqube-to-index-files-in-my-multi-module-gradle-project