Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine cobertura code coverage reports of three separate projects

I have three projects which are stored in three separate repositories. Each of them is a individual mvn project. I wonder is there a way to aggregate three reports in one?

I took a look at the cobertura aggregate function. But seems like it can only handle sub-modules of a project.

Anybody has any suggestion?

like image 717
joewhitedelux Avatar asked Nov 01 '22 11:11

joewhitedelux


1 Answers

The Maven plugin goal cobertura:cobertura supports an aggregate parameter that would work for all the projects in the reactor I suppose.

But you seem to suggest the projects might not be in the same structure/reactor, and i wouldn't know how to do it with maven per-se. However, you can easily do it with a little ant script that can be integrated in your maven structure.

The Cobertura Ant library has a merge task that can merge a number of .ser files (generated by the runtime execution of your instrumented code). This will generate a combined .ser file for which you can generate a xml or html report from.

Let me know if you need more pointers.

like image 140
Patrice M. Avatar answered Nov 13 '22 07:11

Patrice M.