30

Any ideas when cobertura will support java 7?

Found http://sourceforge.net/tracker/index.php?func=detail&aid=3295711&group_id=130558&atid=720018

We preferred cobertura over emma and other code coverage tools and looks like we have to redo all those again, now that none of them support java 7 yet.

Thanks

crankparty
  • 1,230
  • 3
  • 17
  • 26
  • did u find any soultion for cobertura with java 7 – vinod Apr 12 '13 at 09:46
  • 1
    @vinod The latest entry (from 11 April 2013) on the cobertura main website has that "Also Steven is migrating the code to use maven and is working on releasing 2.0 of cobertura soon! Welcome Steven!" – Jagger May 10 '13 at 14:13
  • 2
    And on 29th May 2013 version 2.0 was released which now supports Java 7. – Nick Jun 12 '13 at 09:56
  • This question appears to be off-topic because it is obsolete. – bmargulies Nov 05 '13 at 20:47

5 Answers5

16

Cobertura 2.0.3 supports Java 7, the cobertura-maven-plugin version 2.6 which uses this version has been just released

David Rabinowitz
  • 29,904
  • 14
  • 93
  • 125
  • I know - I've checked out the code and compiled it myself (simply mvn install). – David Rabinowitz Aug 22 '13 at 20:06
  • 1
    Looks like it's in the central repository now. http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22cobertura-maven-plugin%22 – kfox Sep 10 '13 at 04:27
  • hi it is in repository and works well... but if i use the new try-with-resource feature of java7 it tells me the "non existing catch" block is missing in tests... it marks the closing bracket of the try-block – wutzebaer Feb 12 '14 at 12:11
10

I was able to get it to work by adding the following argument:

-XX:-UseSplitVerifier

I got it from here.

Community
  • 1
  • 1
T.K.
  • 2,229
  • 5
  • 22
  • 26
  • i am running from ant..so how can i add it ? – vinod Apr 12 '13 at 09:45
  • I don't know about how your build system is set up, but here's the line that handles it in my build.xml: `` – T.K. Apr 12 '13 at 17:19
  • i dnt know any error when instrumenting but when i starting tomcat it throwing any error "SEVERE: Error listenerStart" but when running without instrumented war the server is running well – vinod Apr 16 '13 at 10:47
  • UseSplitVerifier as a jvm arg works; for ant, you could use the JAVA_OPTS environment variable among many other options. – Dzhaughn Aug 09 '13 at 23:37
  • This worked perfectly for me. See this question for an explanation of why: http://stackoverflow.com/questions/15253173/how-safe-is-it-to-use-xx-usesplitverifier – Michael Calvin Feb 07 '14 at 19:58
3

I think the answer is: it won't. There is discussion on the mailing list that the project is not being maintained, and there are Java 7 bugs that have been open for a year. On the bright side, JaCoCo functionality is comparable and is being actively maintained.

Jason
  • 7,356
  • 4
  • 41
  • 48
  • Yes. Jacoco-hudson plugin is still under development (not the jenkins one) – crankparty Sep 27 '12 at 07:08
  • Don't give up without trying the -XX-UseSplitVerifier option. – Dzhaughn Aug 09 '13 at 23:35
  • eCobertura (the Eclipse plug-in for Cobertura) hasn't been maintained since 2010, but Cobertura itself is still maintained. If you are looking for coverage reports (such as the ones that eCobertura used to provide), just run the Cobertura maven plugin with `mvn cobertura:cobertura` and check the HTML report under `target/site/cobertura/index.html` – MisterStrickland Feb 02 '17 at 16:43
1

Further to Jagger's comment, it looks like this is now being actively worked on for the next release - see:

https://github.com/cobertura/cobertura/commit/b303fdc94851088a3c8699651770faef33180924

with the comment "Fix java 7 stack map issue".

Richard
  • 143
  • 1
  • 10
0

Old thread, but my answer may be useful: Cobertura does support the latest Java versions and is actively maintained. eCobertura (the Eclipse plug-in for Cobertura) hasn't been maintained since 2010, but Cobertura itself is still maintained.

eCobertura will not run with Java 7 or higher, but Cobertura will.

If you are looking for coverage reports (suc h as the ones that eCobertura used to provide), just run the Cobertura maven plugin with mvn cobertura:cobertura and check the HTML report under target/site/cobertura/index.html

MisterStrickland
  • 947
  • 1
  • 15
  • 35