fix: derive JAVA_HOME for sonar-scanner in CI workflow
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:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user