简体   繁体   English

无法在我的多模块Gradle项目中获取声纳索引文件索引

[英]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.

相关问题 SonarQube 用于 Android 的多模块项目 - SonarQube for multi module project for Android 使用Gradle为多模块项目设置SonarQube 5.4:无法通过ClassLoader访问类XYZ - Set up SonarQube 5.4 for multi-module project with Gradle: Class XYZ is not accessible through the ClassLoader 多模块Android Project Gradle建议 - Multi Module Android Project Gradle suggestion 如何在多模块 android 项目(kotlin + java)上配置 SonarQube(使用 jacoco)? - How to configure SonarQube (with jacoco) on multi module android project (kotlin + java)? 我无法将我的项目与 gradle 同步? - I am not able to sync my project with the gradle? Gradle api与多模块项目实施的最佳实践 - Best practice for Gradle api vs implementation in multi-module project Intellij IDEA 13.1.13中具有Android + Gradle的多模块项目 - Multi-module project in Intellij IDEA 13.1.13 with Android+Gradle 如何在Gradle多模块项目中使用ObjectBox? - How to use ObjectBox in Gradle multi-module project? 使用 gradle DSL 在多模块项目中声明风味依赖项 - Declaring flavor dependencies in multi-module project using gradle DSL 多模块gradle项目 - 执行所有单元测试 - Multi-module gradle project - Executing all Unit tests
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM