Jacoco Maven plugin - include test sources

允我心安 提交于 2019-12-11 12:33:20

问题


I'm new in Jacoco maven plugin and trying to add coverage analysis for my test classes (I'm using TestNG with failsafe plugin).

After checking the documentation and some tutorials I made it work on classes in Sources Root (src/main), but couldn't manage to include the classes in Tests Root (src/test). My project consists of only test classes, so the coverage report is required only for these.

In IntelliJ, there is an option "Enable coverage in test folders" which does what I really want. So I think there should be a way to enable these folders in plugin configurations as well.

Thanks for any help!


回答1:


Achieved what I wanted by adding 0.7.6-SNAPSHOT version of jacoco, thanks to heenenee.

Cloned and built the mentioned version of jacoco, installed the jar locally (different instructions here) and added the tests in coverage data by configuration:

<configuration>
    <includeTests>true</includeTests>
</configuration>


来源:https://stackoverflow.com/questions/34483904/jacoco-maven-plugin-include-test-sources

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