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:

https://www.jacoco.org/jacoco/trunk/doc/integrations.html 
<https://www.jacoco.org/jacoco/trunk/doc/integrations.html>

Regards,
-marc


> On 17. Jan 2020, at 12:48, [email protected] wrote:
> 
> 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> <about:invalid#zClosurez>
> 
> 
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/90fdcfc9-0f84-4d00-94ea-7607acbb8773%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/90fdcfc9-0f84-4d00-94ea-7607acbb8773%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <Screen Shot 2020-01-17 at 12.46.58.png>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CBAB4C0C-D1BB-44E1-8A19-07FD47436A9E%40mountainminds.com.

Reply via email to