From e811764e531225aa65f27cede4e0ab1ee592afd8 Mon Sep 17 00:00:00 2001 From: smarkwal Date: Wed, 3 Apr 2024 16:06:59 +0200 Subject: [PATCH] Use SonarQube system property "sonar.token". --- gradle.properties | 2 +- jarhc/build.gradle.kts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 70321ea0..88dce26f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -52,7 +52,7 @@ org.gradle.jvmargs = -Xmx1024m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1024m # Sonar token # alternative: environment variable SONAR_TOKEN # (see ~/.gradle/gradle.properties) -#sonar.login = +#systemProp.sonar.token = # signing information # (see ~/.gradle/gradle.properties) diff --git a/jarhc/build.gradle.kts b/jarhc/build.gradle.kts index d9bca6c2..7e63cc5f 100644 --- a/jarhc/build.gradle.kts +++ b/jarhc/build.gradle.kts @@ -73,10 +73,10 @@ gradle.taskGraph.whenReady { // if sonar task should be executed ... if (gradle.taskGraph.hasTask(":sonar")) { - // environment variable SONAR_TOKEN or property "sonar.login" must be set - val tokenFound = project.hasProperty("sonar.login") || System.getenv("SONAR_TOKEN") != null + // environment variable SONAR_TOKEN or system property "sonar.token" must be set + val tokenFound = System.getProperties().containsKey("sonar.token") || System.getenv("SONAR_TOKEN") != null if (!tokenFound) { - val error = "Sonar: Token not found.\nPlease set property 'sonar.login' or environment variable 'SONAR_TOKEN'." + val error = "Sonar: Token not found.\nPlease set system property 'sonar.token' or environment variable 'SONAR_TOKEN'." throw GradleException(error) } }