Jacoco code coverage show 0% coverage on Jenkins

老子叫甜甜 提交于 2019-12-04 18:43:26

In my case I was using jacocoant 0.6 and the jaCoCo plugin for jenkins was 2.2.0. From the jaCoCo plugin github page:

Version 2.0.0 and higher requires using JaCoCo 0.7.5 or newer, if your projects still use JaCoCo 0.7.4, the plugin will not display any code-coverage numbers any more! In this case please use version 1.0.19 until you can update jacoco in your codebase. https://github.com/jenkinsci/jacoco-plugin

In My case it was failing to get the exec file.

This is because my build directory was different then Jenkins job's WORKSPACE. When i changed the build dir to the WORKSPACE, the magic happened.

In my case, Jacoco plugin is 1.0.19, but I am using Jacoco-maven-plugin 0.7.9 , which it is not compatible.

So, after change Jacoco-maven-plugin to 0.7.4.x. I get correct coverage on Jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!