From d34199ea06bfe4eecc7bd97d61abeba07ee58859 Mon Sep 17 00:00:00 2001 From: SLMS Development Team Date: Sun, 14 Dec 2025 20:51:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DSonarQube=20JaCoCo?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=8E=87=E8=A1=8C=E5=8F=B7=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E9=94=99=E8=AF=AF=20-=20=E5=9C=A8SonarQube=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=89=8D=E6=B8=85=E7=90=86=E6=97=A7=E7=9A=84JaCoCo=20?= =?UTF-8?q?XML=E6=8A=A5=E5=91=8A=20-=20=E7=A7=BB=E9=99=A4=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E4=B8=AD=E7=9A=84jacoco=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=81=BF=E5=85=8D=E5=AF=BC=E5=85=A5=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 91551dd..78551ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,6 +89,16 @@ pipeline { steps { echo '>>> 执行 SonarQube 代码质量检测' withSonarQubeEnv('SonarQube') { + // 先删除旧的JaCoCo报告,避免行号不匹配错误 + bat ''' + @echo off + echo 清理旧的JaCoCo报告... + del /s /q core\\build\\reports\\jacoco\\test\\*.xml 2>nul + del /s /q cli\\build\\reports\\jacoco\\test\\*.xml 2>nul + del /s /q gui\\build\\reports\\jacoco\\test\\*.xml 2>nul + del /s /q backend\\build\\reports\\jacoco\\test\\*.xml 2>nul + echo 已清理旧报告 + ''' bat ''' gradlew.bat sonar ^ -Dsonar.projectKey=%SONAR_PROJECT_KEY% ^ @@ -96,7 +106,6 @@ pipeline { -Dsonar.host.url=%SONAR_HOST_URL% ^ -Dsonar.gradle.skipCompile=true ^ -Dsonar.java.binaries=core/build/classes/java/main ^ - -Dsonar.coverage.jacoco.xmlReportPaths=core/build/reports/jacoco/test/jacocoTestReport.xml,cli/build/reports/jacoco/test/jacocoTestReport.xml,gui/build/reports/jacoco/test/jacocoTestReport.xml,backend/build/reports/jacoco/test/jacocoTestReport.xml ^ --no-daemon ''' }