简体   繁体   English

Jacoco 报告在 intellij 上运行的 apache 项目的覆盖率为 0%

[英]Jacoco report 0% coverage on apache project run on intellij

I have written some unit tests for this project and got jacoco to work producing the reports but the coverage is 0% on every module.I'm working on intellij on Windows but i didn't read that the apache project OpenJpa is system dependant , so it should not be the problem.我已经为这个项目编写了一些单元测试,并让 jacoco 工作生成报告,但每个模块的覆盖率都是 0%。所以这应该不是问题。

Here the main pom.xml link : https://github.com/CecBazinga/openJpa/blob/master/pom.xml这里主要的 pom.xml 链接: https : //github.com/CecBazinga/openJpa/blob/master/pom.xml

Here the pom.xml of the 2 modules in which i have written the unit tests :这里是我编写单元测试的 2 个模块的 pom.xml:

https://github.com/CecBazinga/openJpa/blob/master/openjpa-jdbc/pom.xml https://github.com/CecBazinga/openJpa/blob/master/openjpa-jdbc/pom.xml

https://github.com/CecBazinga/openJpa/blob/master/openjpa-lib/pom.xml https://github.com/CecBazinga/openJpa/blob/master/openjpa-lib/pom.xml

And here the pom.xml of the empty module in which jacoco creates the reports:这里是 jacoco 创建报告的空模块的 pom.xml:

https://github.com/CecBazinga/openJpa/blob/master/tests/pom.xml https://github.com/CecBazinga/openJpa/blob/master/tests/pom.xml

Unit tests work fine but i have no idea why jacoco doesn't register their coverages.单元测试工作正常,但我不知道为什么 jacoco 不注册他们的覆盖范围。 Hope you can help, good day all!希望能帮到你,祝大家天天开心!

经过一些研究/直觉,我发现在 pom.xml 中缺少一些surefire插件依赖项。我集成了它们,现在它工作正常!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM