cobertura-maven-plugin with Java 8

是只有我还是cobertura-maven-plugin不能与java 8一起使用?当它运行时,我得到

[INFO] --- cobertura-maven-plugin:2.6:instrument (default) @ provider-impl ---
[INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura] WARN  [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /var/lib/jenkins/workspace/BranchBuilder/implementations/provider-impl/target/generated-classes/cobertura/com/foo/impl/internal/ServiceProviderImpl$JoinRunner.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)

我知道ASM和java 8存在问题,所以我怀疑问题是maven插件尚未更新为使用与java-8兼容的ASM版本

作为参考,我在这里问了这个问题,但没有得到答案

有没有人设法将cobertura-maven-plugin与java 8一起使用?


答案 1

我能够通过手动更新cobetura-maven-plugin使用的ASM依赖项来使其正常工作。以下是包含更多详细信息的链接:http://www.befreeman.com/2014/09/getting-cobertura-code-coverage-with.html


答案 2

这是一个悬而未决的问题,使它理解新的类格式,
https://github.com/mojohaus/cobertura-maven-plugin/issues/21


推荐