0

I'm getting an Authorisation Error while executing "gradlew sonarqube" I've added these properties in app level 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"

}

}

These I kept in gradle.properties

systemProp.sonar.host.url=https://sonarcloud.io systemProp.sonar.login=967dcfc8faf76abdbb560889d5087245faa69a5b

Getting this exception in terminal;

* What went wrong:

Execution failed for task ':app:sonarqube'.

Not authorized. Please check the properties sonar.login and sonar.password.

1 Answers1

0

The configuration you posted is missing the sonar.organization required property.

Btw, all the other properties in sonarqube { properties { ... } } in your posted example should not be necessary, the SonarQube plugin for Gradle should detect and include them automatically in the analysis.

janos
  • 120,954
  • 29
  • 226
  • 236