-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using Java 8 #166
Comments
What version of Cobertura are you using, what versions of the other libraries, cobertura needs are you using? |
Using Maven
|
Maven plugin isn't upgraded to be compatible with java 8. There were some recent changes in core to allow for java 8 compatibility, however I have yet to write any test units testing the latest functionality. I think over the break I will do some major work on cobertura (removing java -1.5 compatibility, etc. to fix a lot of the issues people are encountering. |
Any updates on this?
I imagine it is caused by ASM not liking java 8? |
I'm getting the same issue as @theHilikus with my java8 project. Any feedback regarding this? |
The Cobertura Maven Plugin uses Cobertura 2.0.3, as can be seen in the build log. What happens if you use the latest 2.1.0-SNAPSHOT version of Cobertura from the command line, i.e. not using the Maven plugin? Cobertura 2.1.0-SNAPSHOT uses ASM 5.0, which is supposed to be Java 8 compatible. |
I have updated the Maven Cobertura Plugin to use the latest 2.1.0-SNAPSHOT of Cobertura. Please give version 2-7-SNAPSHOT of the plugin it a try. Also if you are only using the Cobertura jar, version 2.1.0-SNAPSHOT of that has been deployed to the SNAPSHOT-repository. Others have had some success with the latest versions, see https://jira.codehaus.org/browse/MCOBERTURA-189 But, there seems to be a problem with JavaNCSS and Java 8. JavaNCSS is used inside Cobertura, but Cobertura has a copy of (an old version of) the JavaNCSS classes. So updating to a newer version of JavaNCSS is not an easy task. I gave it a try, but haven't been able to finish it yet. |
@dennisl thank you for the update. I am currently in the middle of releasing so I can't use an unstable plugin. I will try to test it next week. |
Oh, I also forgot to ask. There's another workaround mentioned here. What do you think of it? at least it seems to allow using the latest stable version of the plugin (2.6). I tried it and it seemed to work, although with some strange warnings |
@theHilikus The Cobertura SNAPSHOTs are available in this repo: The Cobertura Maven Plugin SNAPSHOTs are available in this repo: There are no SNAPSHOTs in Maven central, so if you are about to release you need to stick with non-SNAPSHOT versions. |
@theHilikus That workaround might work, but there are 5 dependencies on ASM artifacts in Cobertura, so ideally you'd need to add them all with the updated version. They are specied in this POM: |
@dennisl I'm having trouble hitting the Maven plugin snapshots repo. I've googled around for examples (haven't worked with Nexus in years) but I think maybe I'm just missing the appropriate value. Can you provide it? I took a guess and ended up with the following:
FWIW the solution linked by @theHilikus allows me to run, so this isn't urgent from our point of view. However, if you need some legwork done on the issue, I'd be happy to help. |
This is the setting that I use: <pluginRepositories>
<pluginRepository>
<id>codehaus-nexus-snapshots</id>
<name>Codehaus Nexus Snapshots</name>
<url>https://nexus.codehaus.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories> Let me know if you have problems using the Maven plugin SNAPSHOT. |
@dennisl now that the issue is closed, is it just a matter of waiting for the 2.7 release of cobertura-maven-plugin?? |
@theHilikus I am pushing first for a release of Cobertura, and after that a release of the Maven plugin. |
makes sense. i just wanted to know what were the missing steps to having a working plugin. I was also assuming that Cobertura had already been released, which I see is wrong |
Do we have a date for 2.1 release? |
ASAP |
Hi @dennisl
The other error I see is too long to post all of it but this is the main part. It is related to lambdas
Thank you for your help again |
The first problem I have not seen before. Could you please open a separate issue for that. If you could include a small test class that shows the issue, it would be very helpful. The second one is not about the instrumentation or the calculation of coverage. The report should be ok despite the warning in the log. This is really about a problem in JavaNCSS, which is used by Cobertura. It is tracked in issue #220 |
I'm experiencing the same issue reported by @theHilikus, so I opened issue #248 for it. |
@dennisl great job ;-) thanks. i have a similar issue with gradle-plugin, but i assume it is not cobertura's problem now, since 2.1 release. |
Is there an ETA for Cobertura support for Java 8 ? |
Any news on the support for Java 8? Java 9 is coming out for god sake. |
Java 9 is out :-) |
Motivation: The old version of cobertura-maven-plugin is apparently corrupting .class files, triggering VerifyError during tests. I see this only after I've run `mvn versions:set` and I'm running `mvn site:jar`. Presumably it's cobertura/cobertura#166 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=180834879
The Cobertura Maven plugin (and Cobertura itself) doesn't support Java 8. Additionally, code coverage metrics are currently not used anywhere in the build, so we can as well remove it. Refs mojohaus/cobertura-maven-plugin#21 Refs cobertura/cobertura#166
The Cobertura Maven plugin (and Cobertura itself) doesn't support Java 8. Additionally, code coverage metrics are currently not used anywhere in the build, so we can as well remove it. Refs mojohaus/cobertura-maven-plugin#21 Refs cobertura/cobertura#166
Motivation: The old version of cobertura-maven-plugin is apparently corrupting .class files, triggering VerifyError during tests. I see this only after I've run `mvn versions:set` and I'm running `mvn site:jar`. Presumably it's cobertura/cobertura#166 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=180834879
I've literally been waiting this since first quarter of 2017 :/ I guess it was a good run... moving on to JaCoCo |
I'm trying to run Cobertura for Java 8 project. I get errors like
java.lang.VerifyError: Expecting a stackmap frame at branch target 78
Using -XX:-UseSplitVerifier does not help since I think it was dropped in Java 8.
The text was updated successfully, but these errors were encountered: