Update SonarQube environment configuration to use 'SonarQube-Server' and change token variable to 'SONAR_AUTH_TOKEN'

This commit is contained in:
Enno Gelhaus 2025-10-03 15:16:34 +02:00
parent c124aa648b
commit 77b91d4d7c
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ pipeline {
// 2. Use withSonarQubeEnv to set up the environment and PATH for sonar-scanner.
// IMPORTANT: Replace 'YourSonarServerName' with the name you configured
// for your SonarQube server instance in Jenkins (Manage Jenkins -> Configure System).
withSonarQubeEnv(installationName: 'YourSonarServerName') {
withSonarQubeEnv(installationName: 'SonarQube-Server') {
// 3. Execute sonar-scanner CLI
sh """
echo "Starting SonarQube Analysis for project version: ${commitShaShort}"
@ -59,7 +59,7 @@ pipeline {
-Dsonar.projectVersion=${commitShaShort} \\
-Dsonar.sources=. \\
-Dsonar.host.url=\${SONAR_HOST_URL} \\
-Dsonar.token=\${SONAR_TOKEN}
-Dsonar.token=\${SONAR_AUTH_TOKEN}
# Add -Dsonar.projectKey=YourKeyHere if not defined in sonar-project.properties
"""
}