问题
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