【发布时间】:2017-08-25 11:13:04
【问题描述】:
我已将我的项目设置为与 Sonarqube 一起使用。我使用 PMD 和 Checkstyle 运行测试,所有测试都成功登录到 Sonarqube 控制台。但昨天我决定将 Android lint 规则也添加到我的质量配置文件中。我已在新配置文件中激活所有 Lint 规则并运行该项目。现在,当我运行该项目时,它没有显示此配置文件的任何错误或问题。当我在本地运行 lint 时,我遇到了大约 400 个问题。我可能会错过什么?
我在我的服务器上使用 Gradle 和 Sonarqube 6.2 中的 Sonarqube 插件。我的Sonarqube配置如下
apply plugin: "org.sonarqube"
sonarqube {
//noinspection GroovyAssignabilityCheck
properties {
//noinspection GroovyAssignabilityCheck
property "sonar.projectName", "MyProject"
//noinspection GroovyAssignabilityCheck
property "sonar.projectKey", "Testapplication"
//noinspection GroovyAssignabilityCheck
property "sonar.projectVersion", "1.0"
//noinspection GroovyAssignabilityCheck
property "sonar.analysis.mode", "publish"
//noinspection GroovyAssignabilityCheck
property "sonar.language", "java"
//noinspection GroovyAssignabilityCheck
property "sonar.sources", "src/main/"
//noinspection GroovyAssignabilityCheck
property "sonar.profile", "FindBugs"
//noinspection GroovyAssignabilityCheck
property "sonar.host.url", "http://192.168.21.33:9000"
//noinspection GroovyAssignabilityCheck
property "sonar.login", "admin"
//noinspection GroovyAssignabilityCheck
property "sonar.password", "admin"
property "sonar.exclusions","es.miguelprietos.testapplication/R.java"
property "sonar.android.lint.report", "build/outputs/lint-results.xml"
property "sonar.binaries", "build/intermediates/classes/debug"
property "sonar.java.binaries", "build/intermediates/classes/debug"
}
}
我使用以下命令来运行我的声纳任务(无参数)。
./gradlew sonarqube
我的 Gradle 中配置的 Lint 选项如下
lintOptions {
// set to true to turn off analysis progress reporting by lint
quiet true
// if true, stop the gradle build if errors are found
abortOnError false
// if true, only report errors
ignoreWarnings true
}
【问题讨论】:
-
在应用的 build.gradle 中显示您的 lintOptions。你的 lint 报告是空的吗?
-
请阅读Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - 总结是这不是解决志愿者的理想方式,并且可能会适得其反。请不要将此添加到您的问题中。
-
@shmakova 添加了在我的应用级别 build.gradle 中配置的 lint 选项
标签: android gradle sonarqube sonarlint