I have a maven multi module project.
root:
moduleA/ # no unit tests
moduleB/ # no unit tests
moduleC/ # no unit tests
tests/ # All unit tests, since depends on modules A, B and C
All tests are in single module called tests/ and all code is in separate modules.
Is there a way I can get code coverage?
I don't think either of
jacocoorcoberturais capable of reporting code coverage across modules. You may want to try instrumenting the compiled classes before running the test coverage report rather than relying on on-the-fly instrumentation.See this
jacocomaven goal to perform the offline instrumentation.