Skip to content

Commit 4d1adcd

Browse files
authored
Enable coverage reports in SonarQube (#5)
1 parent d313238 commit 4d1adcd

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Jenkinsfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pipeline {
3232
junit 'target/surefire-reports/TEST-*.xml'
3333
jacoco classPattern: 'target/classes,target/test-classes', execPattern: 'target/coverage-reports/*.exec', inclusionPattern: '**/*.class', sourcePattern: 'src/main/java,src/test/java'
3434
archiveArtifacts 'target/surefire-reports/TEST-*.xml'
35-
archiveArtifacts 'target/coverage-reports/*.exec'
35+
archiveArtifacts 'target/*.exec'
3636
}
3737
}
3838
}
@@ -58,8 +58,7 @@ pipeline {
5858
mvn sonar:sonar -B -V -Dsonar.projectKey=workflow_k8s_scheduler \
5959
-Dsonar.branch.name=$BRANCH_NAME -Dsonar.sources=src/main/java -Dsonar.tests=src/test/java \
6060
-Dsonar.inclusions="**/*.java" -Dsonar.test.inclusions="src/test/java/**/*.java" \
61-
-Dsonar.junit.reportPaths=target/surefire-reports \
62-
-Dsonar.jacoco.reportPaths=$(find target/coverage-reports -name '*.exec' | paste -s -d , -)
61+
-Dsonar.junit.reportPaths=target/surefire-reports
6362
'''
6463
}
6564
}

jenkins-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
---
22
apiVersion: v1
33
kind: Pod
44
spec:

pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@
139139
<artifactId>jacoco-maven-plugin</artifactId>
140140
<version>0.8.7</version>
141141
<configuration>
142-
<destFile>${project.build.directory}/coverage-reports/jacoco-unit.exec</destFile>
143-
<dataFile>${project.build.directory}/coverage-reports/jacoco-unit.exec</dataFile>
144-
<outputDirectory>${project.reporting.outputDirectory}/jacoco-report</outputDirectory>
145142
<propertyName>surefireArgLine</propertyName>
146143
</configuration>
147144
<executions>

0 commit comments

Comments
 (0)