gradle-cobertura-plugin icon indicating copy to clipboard operation
gradle-cobertura-plugin copied to clipboard

gradle-cobertura-plugin:2.3.2 is not being supported in Java 8

Open aviyepuri opened this issue 8 years ago • 3 comments

Hi We just got migrated to Gradle 3 and Java 1.8. The cobertura-plugin ( net.saliman:gradle-cobertura-plugin:2.3.2 ) that we declare in build.gradle file isn't behaving as expected. But when I change the project SDK to 1.7 the build was success. Can't we use the above plugin with Java 1.8, or is there any other version that I need to use for 1.8?

Here is the stack trace that I see:

Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Unable to instrument file xxxxxxxx

aviyepuri avatar Oct 18 '16 18:10 aviyepuri

Unfortunately, there is a long standing bug with Cobertura and Java 8 when using certain Java 8 features like lambdas, documented in [https://github.com/cobertura/cobertura/issues/176].

I've been following that issue waiting for a fix, and as soon as it gets fixed, I'll release a new version of the plugin that uses that version of cobertura.

Sorry I couldn't be of more help,

Steve

stevesaliman avatar Oct 21 '16 01:10 stevesaliman

Hi @stevesaliman Latest cobertura pull add some Java 8 support. How can I contribute to your plugin to support latest commit from cobertura?

Thx, Will

silvaw avatar Mar 27 '18 14:03 silvaw

Thank you @silvaw for the offer. Not too many people offer to jump in and help :-)

As soon as the Cobertura team releases a new version to the standard repositories, we will be able to bump the default coberturaVersion the plugin brings in. It doesn't look like any of the command line arguments have changed, so there should be nothing more to do than a simple version bump.

Until then, if you want to use the latest Cobertura commit with the gradle cobertura plugin, you can do it in two steps:

  1. clone the main cobertura repository and install int locally with mvn -DskipTests install. Unfortunately, this would need to be done on every machine in your environment that needs to use the new version of cobertura. Alternately, you could create the artifacts needed and upload them to your own repository.
  2. Add coberturaVersion = '2.1.2-SNAPSHOT' to the cobertura block of your build.gradle file.

stevesaliman avatar Apr 01 '18 16:04 stevesaliman