Skip to content

Commit df27968

Browse files
committed
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 <[email protected]>
1 parent c40abb0 commit df27968

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
fixes:
3+
- |
4+
Replace deprecated ``sonar.login`` property with ``sonar.token`` in
5+
SonarCloud integration scripts. The ``sonar.login`` property has been
6+
deprecated by SonarCloud and will be removed in future versions.
7+
8+
This change eliminates the following warning that appeared in job logs
9+
and SonarCloud analysis status pages:
10+
11+
"The property 'sonar.login' is deprecated and will be removed in the
12+
future. Please use the 'sonar.token' property instead when passing a
13+
token."
14+
15+
Affected scripts:
16+
17+
* ``shell/maven-sonar.sh`` - Maven-based SonarCloud jobs
18+
* ``shell/cmake-sonar.sh`` - CMake-based SonarCloud jobs

shell/cmake-sonar.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts ..
5959
-Dsonar.sources=. \
6060
-Dsonar.cfamily.build-wrapper-output="$WORKSPACE/bw-output" \
6161
-Dsonar.host.url="${SONAR_HOST_URL}" \
62-
-Dsonar.login="${API_TOKEN}"
62+
-Dsonar.token="${API_TOKEN}"

shell/maven-sonar.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _JAVA_OPTIONS="$JAVA_OPTS" $MVN $MAVEN_GOALS \
3434
if [ "$SONAR_HOST_URL" = "https://sonarcloud.io" ]; then
3535
params+=("-Dsonar.projectKey=$PROJECT_KEY")
3636
params+=("-Dsonar.organization=$PROJECT_ORGANIZATION")
37-
params+=("-Dsonar.login=$API_TOKEN")
37+
params+=("-Dsonar.token=$API_TOKEN")
3838
if [ "$SCAN_DEV_BRANCH" = "True" ]; then
3939
echo "Will scan short lived branch ..."
4040
# shellcheck disable=SC2236

0 commit comments

Comments
 (0)