Closed cobratbq closed 4 years ago
Jacoco is definitely the way to go since cobertura is not maintained anymore. I have a working integration into the reporting features of maven in another project. You can try to adapt the solution from there: https://code.cor-lab.org/projects/rsb/repository/rsb-java/revisions/master/entry/pom.xml
Alright, so that's the clue. One can use the same plugin in both sections 'build' and 'reporting'. Thanks, fixed and created PR https://github.com/otr4j/otr4j/pull/34.
Isn't this solved?
I've created a branch where JaCoCo is included in Maven pom.xml. I'm not sure if this is the approach we like to take, so I'm putting it here as a suggestion. Please have a look and see for yourself.
If you run
mvn verify
it creates a report intarget/site/jacoco/
. Unfortunately this report is not integrated with the other reports generated withmvn site
. There is also an alternative plugin for Cobertura code coverage, but the JaCoCo solution seems to be more active and more current. (Supports Java 8, for example.)A sample report can be found at the JaCoCo homepage: http://www.eclemma.org/jacoco/trunk/coverage/index.html
Also keep in mind that unit tests run slower when JaCoCo instruments the classes before testing. Is this desirable?