执行“gradlew sonarqube”时出现授权错误我已在应用程序级别的 gradle 中添加了这些属性
sonarqube {
properties {
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.projectName', 'ToDoTest'
property 'sonar.projectKey','967dcfc8faf76abdbb560889d5087245faa69a5b'
property "sonar.language", "kotlin"
property "sonar.sources", "app/src/main/java"
property "sonar.binaries", "app/build"
property "sonar.java.binaries", "target/classes,app/build/tmp/kotlin-classes"
property "sonar.tests", "app/src/test/java, app/src/androidTest/java"
property "sonar.java.test.binaries", "app/build/intermediates/classes/debug"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.junit.reportsPath", "app/build/test-results/testDebugUnitTest"
property "sonar.android.lint.report", "app/build/reports/lint-results.xml"
property "sonar.jacoco.reportPath","app/build/jacoco/testDevDebugUnitTest.exec"
}
}
这些我保存在 gradle.properties
systemProp.sonar.host.url = https://sonarcloud.io systemProp.sonar.login=967dcfc8faf76abdbb560889d5087245faa69a5b
在终端中获取此异常;
* What went wrong:
任务 ':app:sonarqube' 的执行失败。
未经授权。请检查属性 sonar.login 和 sonar.password。