将您的声纳属性更改为以下内容:
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.projectName", "appa"
property "sonar.projectKey", "appa_app"
property "sonar.projectVersion", "1.0"
property "sonar.analysis.mode", "publish"
property "sonar.language", "java"
property 'sonar.sourceEncoding', "UTF-8"
property "sonar.sources", "./src/main"
property "sonar.host.url", "http://192.168.21.33:9000"
property "sonar.login", "admin"
property "sonar.profile", "testlint"
property 'sonar.import_unknown_files', true
property "sonar.android.lint.report", "./build/outputs/lint-results-debug.xml"
property "sonar.password", "admin"
property "sonar.java.binaries", "build/"
}
}
要创建lint-results-debug.xml文件,您需要在工作室终端上运行以下命令:
./gradlew lint
它将生成缺失的XML报告。请注意,它可以为每个构建变体生成报告(默认情况下Debug会生成build/outputs/lint-results-debug.xml)。因此,您可以根据构建变体调用lintDebug、lintRelease等命令。
并将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
// do not ignore warnings
warningsAsErrors true
}
现在如果你运行。
./gradlew sonarqube
你将会得到所示结果,实际上是本地文件报告,实际上是托管在服务器上的
。