fix: derive JAVA_HOME for sonar-scanner in CI workflow
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m53s
CI / docker (push) Successful in 14s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 35s

sonar-scanner 6.x requires JAVA_HOME or java on PATH. The build
container has Java installed but doesn't export JAVA_HOME, so
derive it from the java binary location.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-04 10:05:18 +02:00
parent 352fa43ef8
commit 2589c681c5

View File

@@ -72,6 +72,10 @@ jobs:
- name: SonarQube Analysis
run: |
# Derive JAVA_HOME from the java binary on PATH (set by build image)
if [ -z "$JAVA_HOME" ]; then
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
fi
sonar-scanner \
-Dsonar.host.url="$SONAR_HOST_URL" \
-Dsonar.token="$SONAR_TOKEN" \