Hi,

I met the same problem with you, now, I use jenkins cobuertural plugin, which 
will help me generate a whole report, not only include some packages :)

Br,
Tim

-----Original Message-----
From: kfmoh...@uci.edu [mailto:kfmoh...@uci.edu] 
Sent: Sunday, July 01, 2012 9:51 AM
To: Maven Users List
Subject: Re: Code coverage report for multi module maven project reports zero 
in some modules

Yes, I have moduleA, moduleB, moduleC, moduleD, moduleE and module F. I
run JUnit tests from module F.

The report in the moduleF/target... directory has the required coverage
information. However, the coverage report in the other modules reports
line and code coverage as zero.

I did try to use the aggregate option with setting it to true, to see an
aggregate coverage report for all modules, it gives the aggregate report,
but again only for packages in moduleF(from where we run JUnit tests) and
reports as zero for all other modules.

I am trying what was suggested in the first response to this question.

Is there a way that we generate the code coverage report for all modules,
with out using ant and only with use of cobertura ?

Thanks

> Aggregated cobertura report will execute cobertura on each module and then
> merge the single reports. It will not help if, for example, you have tests
> in module A and want to have coverage of module B.
>
>
> On Sat, Jun 30, 2012 at 10:46 AM, Patrick Mohr <kc7...@gmail.com> wrote:
>
>> On Sat, Jun 30, 2012 at 12:18 AM, Aliaksei Lahachou <
>> aliaksei.lahac...@gmail.com> wrote:
>>
>> > Hi!
>> >
>> > cobertura:cobertura executes it's own lifecycle: instruments the
>> classes,
>> > instrumented classes are saved to target/generated-classes/cobertura,
>> and
>> > executes unit tests. Instrumented classes dump coverage data to
>> > target/conbertura/cobertura.ser. There are two things to understand:
>> >
>> > 1. When cobertura:cobertura is executed, dependencies are not
>> instrumented.
>> > You have to have enabled instrumentation, see cobertura:instrument
>> goal.
>> > This will produce jars with instrumented classes, so be careful not to
>> > distribute them.
>> > 2. Each module will write coverage data to it's own
>> > target/conbertura/cobertura.ser file. I think it's possible to
>> configure
>> > instrumentation so that all jars write to the same cobertura.ser file,
>> but
>> > I don't know whether it's normal, and I never tried that.
>> >
>> >
>> I want to say that there's a cobertura target.  Something like
>> cobertura:aggregate that will combine the results off all the unit
>> tests,
>> for the module that's being tested.  That probably won't be what you
>> want,
>> but I think it would be a lot closer.  This is all from memory though,
>> so
>> make sure to check it's actually what you want.
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to