With jacoco 0.8.5 and jenkins pipeline syntax, The code coverage in jenkins shows as 0 while the same is visible in sonar

32 views
Skip to first unread message

pallavia...@gmail.com

unread,
Jan 17, 2020, 6:48:04 AM1/17/20
to JaCoCo and EclEmma Users
With jacoco 0.8.5 and jenkins pipeline syntax, The code coverage in jenkins shows as 0 while the same is visible in sonar

The configuration for the jenkins file is: 

always {
junit '**/target/*-reports/TEST-*.xml'

step([$class: 'JacocoPublisher',
execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes',
sourceInclusionPattern: '**/src/main/java',
inclusionPattern: '**/*.class',
exclusionPattern: '**/*Test*'
])
}

Can someone please tell me, what am I missing in the same.

The jenkins logs says: 

[JaCoCo plugin] Collecting JaCoCo coverage data...
[JaCoCo plugin] **/target/jacoco.exec;**/target/classes;**/src/main/java; locations are configured
[JaCoCo plugin] Number of found exec files for pattern **/target/jacoco.exec: 1
[JaCoCo plugin] Saving matched execfiles:  /home/jenkins/agent/workspace/************/target/jacoco.exec
[JaCoCo plugin] Saving matched class directories for class-pattern: **/target/classes: 
[JaCoCo plugin]  - /home/jenkins/agent/workspace/***********/target/classes 30 files
[JaCoCo plugin]  - /home/jenkins/agent/workspace/***********/target/classes 30 files
[JaCoCo plugin] - /home/jenkins/agent/workspace/***********/target/classes 98 files
[JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java: [JaCoCo plugin] Source Inclusions: **/src/main/java [JaCoCo plugin] Source Exclusions: [JaCoCo plugin] - /home/jenkins/agent/workspace/***********/src/main/java 0 files
[JaCoCo plugin] - /home/jenkins/agent/workspace/***********/src/main/java 0 files
[JaCoCo plugin] - /home/jenkins/agent/workspace/***********/src/main/java 0 files
[JaCoCo plugin] Loading inclusions files.. [JaCoCo plugin] inclusions: [**/*.class] [JaCoCo plugin] exclusions: [**/*Test*] [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0] [JaCoCo plugin] Publishing the results.. [JaCoCo plugin] Loading packages.. [JaCoCo plugin] Done. [JaCoCo plugin] Overall coverage: class: 100, method: 100, line: 100, branch: 100, instruction: 100

The screenshot is as below in jenkins:

Screen Shot 2020-01-17 at 12.46.58.png



Marc Hoffmann

unread,
Jan 19, 2020, 2:32:49 PM1/19/20
to JaCoCo and EclEmma Users
Hi,

neither the Jenkins plugin not Sonar is maintained by the JaCoCo team and therefore we cannot provide support here. Please see this page for links to the respective integrations:


Regards,
-marc




--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/90fdcfc9-0f84-4d00-94ea-7607acbb8773%40googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages