tags:

views:

515

answers:

3

is it possible to have the output html reports have highlighting where code was covered in a maven build? I know you can in standalone emma and with ant, but I haven't yet figured out how to do this with maven and emma. Thanks.

Jeff

A: 

You need to set the sourcepath= attribute on the report tag and you to specify at least(?) coverage depth="method" on the html tag if I remember correctly.

jitter
I tried that and ran the emma plugin on debug and it was using the correct sourcepath, but still no luck. I figured it had to be on line coverage for line highlighting, but the maven plugin didn't have that option.
Jeff Storey
+1  A: 

I don't know if this is possible with the Emma Maven plugin, but this is the default behaviour for the Cobertura Maven plugin. It also gives you the number of times a line is hit, which can be useful in determining where your testing is minimal. See this report for an example of the output.

I find Cobertura and Emma to be largely interchangeable in terms of coverage checking, just that Cobertura has a better Maven plugin and Emma has a better Eclipse plugin in my opinion.

Rich Seller
+1  A: 

This is the default behaviour of the EMMA plugin if you run mvn emma:emma or add it to the <reporting> element. You can find a working example here: http://github.com/brettporter/centrepoint/blob/master/centrepoint/modules/pom.xml

Brett Porter