From 7810cb7d8e1939e40bb06199e1772e0801227b95 Mon Sep 17 00:00:00 2001 From: Thilo Schwarz Date: Sun, 6 Apr 2025 18:48:03 +0200 Subject: [PATCH] Update CI pipeline to include build step before Sonar scan Added a Maven build step (`mvn clean package -DskipTests`) to ensure compiled binaries are available for the SonarQube analysis. Also specified the `sonar.java.binaries` parameter to point to the correct output directory. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5f9159..2950f64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,8 @@ sonarcloud_scan: paths: - .maven-cache script: - - sonar-scanner -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.organization=${SONAR_ORGANIZATION} -Dsonar.token=${SONAR_TOKEN} + - mvn clean package -DskipTests + - sonar-scanner -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.organization=${SONAR_ORGANIZATION} -Dsonar.token=${SONAR_TOKEN} -Dsonar.java.binaries=target/classes only: - merge_requests - develop