Fix: Replace deprecated sonar.login -> sonar.token 03/73803/1 v0.92.7
authorAnil Belur <abelur@linuxfoundation.org>
Mon, 20 Oct 2025 02:13:01 +0000 (12:13 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 20 Oct 2025 02:23:50 +0000 (12:23 +1000)
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 <abelur@linuxfoundation.org>
releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml [new file with mode: 0644]
shell/cmake-sonar.sh
shell/maven-sonar.sh

diff --git a/releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml b/releasenotes/notes/replace-deprecated-sonar-login-cf1ae2e5e16aa6dd.yaml
new file mode 100644 (file)
index 0000000..0235449
--- /dev/null
@@ -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
index 0bbf559..cdca155 100644 (file)
@@ -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}"
index a2de475..5075bf7 100644 (file)
@@ -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