[英]Not able to get sonarqube to index files in my multi module gradle project
I have a multi-module gradle project created in android studio and want to run an analysis using sonarqube. 我在android studio中创建了一个多模块gradle项目,并希望使用sonarqube进行分析。 The project structure is as below root (no source files) Module 1 com.myapp.module1 package1 package2
项目结构如下根(无源文件)模块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 我在根目录的build.gradle文件中添加了sonarqube插件以及以下sonarqube属性:a)主机URL b)jdbc url c)jdbc的用户名d)jdbc的密码
I use gradlew for the build. 我使用gradlew进行构建。 When I run gradlew sonarqube from my root directory, sonarqube runs but indicates that 0 files are indexed for all the modules.
当我从根目录运行gradlew sonarqube时,sonarqube会运行,但表示为所有模块索引了0个文件。
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.
这应该是相当明显的,但是我无法在现有的stackoverflow档案中找到答案。
I had to explicitly have sonar.sources property in each of the module. 我必须在每个模块中明确拥有sonar.sources属性。
sonarqube { properties { properties["sonar.sources"] += "src" }
} sonarqube { properties { properties["sonar.sources"] += "src" }
}
you dont have to put sonar.sources in each module 您不必在每个模块中放置sonar.sources
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? 用子模块配置Android项目以与sonarqube gradle插件一起使用的正确方法是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.