hudson cobertura reporting 0
Asked Answered
J

2

5

I have a problem that when I run the cobertura target maven, the report always shows 0%.I've tried forking my junit tests, and no luck. I've tried configuring the cobertura plugin in the reporting section and build section of the pom, and also tried binding it to both the site and package phase. Any thoughts?

On a related note, I've also noticed that running the tests in Cobertura within hudson causes the junit plugin to report that each test was run twice (which doubles the number of tests reported as run). Any way around this?

thanks,

Jeff

Jadeite answered 19/6, 2009 at 0:44 Comment(0)
J
6

There is a compatibility issue with JDK 1.6.0_14 and the cobertura plugin. And the plugin also has problems with multithreaded tests. The 0% problem was fixed by used b7 of JDK6, and maybe a fix will come out for the multithreading soon (there is a patch available)

Jadeite answered 19/6, 2009 at 23:39 Comment(3)
I had the same 0% problem with 1.6.0_14. Tried with 1.6.0_13 and it worked. Thanks!Dhoti
update - cobertura 1.9.2 has been released which fixes the problemJadeite
Make sure you use the cobertura-plugin version 2.4. I had this same problem with 1.6.0_17, but upgrading the plugin helped.Mishnah
C
1

I think it would be helpful to post whatever part of the pom.xml you define your Cobertura plugin and where in your profile you actually use it. Could you provide this so it provides some context for someone to look at? While I'm sure that copying/pasting [http://mojo.codehaus.org/cobertura-maven-plugin/usage.html] wouldn't help any of us out, perhaps providing your < include> and < excludes> can help out.

Cordova answered 19/6, 2009 at 3:2 Comment(2)
sure. it's pretty basic <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.2</version> <formats> <format>xml</format> <format>html</format> </formats> </configuration> </plugin> </plugins> </reporting> I'm also finding something weird that maven puts the classes in a directory called target/generated-classes/cobertura but the maven site says it should look for them in target/cobertura/classes, so I'm guessing that's part of the problem.Jadeite
looks like there is some conflict with version 1.6.0_14 with the JDK. I ran it with 1.6.0_07 and it worked fine.Jadeite

© 2022 - 2024 — McMap. All rights reserved.