From df27968271e533af48bf0d803ef1fb852be5f1df Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Mon, 20 Oct 2025 12:13:01 +1000 Subject: [PATCH] Fix: Replace deprecated sonar.login -> sonar.token The sonar.login property is deprecated and will be removed in future versions of SonarQube. Replace it with sonar.token as recommended by SonarCloud. Fixes warnings reported in job logs and SonarCloud analysis status. Change-Id: I1cee4720c8e22ae263292c20f7cafa0aa1f3d0f6 Signed-off-by: Anil Belur --- ...eplace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml | 18 ++++++++++++++++++ shell/cmake-sonar.sh | 2 +- shell/maven-sonar.sh | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml diff --git a/releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml b/releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml new file mode 100644 index 00000000..02354498 --- /dev/null +++ b/releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml @@ -0,0 +1,18 @@ +--- +fixes: + - | + Replace deprecated ``sonar.login`` property with ``sonar.token`` in + SonarCloud integration scripts. The ``sonar.login`` property has been + deprecated by SonarCloud and will be removed in future versions. + + This change eliminates the following warning that appeared in job logs + and SonarCloud analysis status pages: + + "The property 'sonar.login' is deprecated and will be removed in the + future. Please use the 'sonar.token' property instead when passing a + token." + + Affected scripts: + + * ``shell/maven-sonar.sh`` - Maven-based SonarCloud jobs + * ``shell/cmake-sonar.sh`` - CMake-based SonarCloud jobs diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index 0bbf559e..cdca155e 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -59,4 +59,4 @@ eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts .. -Dsonar.sources=. \ -Dsonar.cfamily.build-wrapper-output="$WORKSPACE/bw-output" \ -Dsonar.host.url="${SONAR_HOST_URL}" \ - -Dsonar.login="${API_TOKEN}" + -Dsonar.token="${API_TOKEN}" diff --git a/shell/maven-sonar.sh b/shell/maven-sonar.sh index a2de475e..5075bf76 100644 --- a/shell/maven-sonar.sh +++ b/shell/maven-sonar.sh @@ -34,7 +34,7 @@ _JAVA_OPTIONS="$JAVA_OPTS" $MVN $MAVEN_GOALS \ if [ "$SONAR_HOST_URL" = "https://sonarcloud.io" ]; then params+=("-Dsonar.projectKey=$PROJECT_KEY") params+=("-Dsonar.organization=$PROJECT_ORGANIZATION") - params+=("-Dsonar.login=$API_TOKEN") + params+=("-Dsonar.token=$API_TOKEN") if [ "$SCAN_DEV_BRANCH" = "True" ]; then echo "Will scan short lived branch ..." # shellcheck disable=SC2236 -- 2.16.6