We are using jacoco on a java library with several modules and using the check goal to check for a certain level of coverage. We use report-aggregate to get a final report. We notice that when we don't use haltOnFailure=false, then if the first module fails, no coverage report is created and subsequent modules aren't tested. This isn't ideal for us, so we used haltOnFailure=false, so now coverage reports are always generated, BUT if a check fails, the mvn command exits with code 0, which makes it look like a successful build.
Is there a way to generate all coverage reports for all modules AND fail the build if a check fails?
We were thinking of writing some code to process the jacoco.xml and compare the report's values to the jacoco check values in the pom.xml, but this seems strange to have to do. Any help would be appreciated! Thanks!