Not able to get sonarqube to index files in my multi module gradle project

两盒软妹~` 提交于 2019-12-11 13:45:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!