JaCoCo SonarQube不兼容版本1007 [英] JaCoCo SonarQube incompatible version 1007

查看:88
本文介绍了JaCoCo SonarQube不兼容版本1007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SonarQube进行代码质量控制,但突然之间构建的结果无法通过分析并无法通过.

I'm using SonarQube for code quality control and suddenly builds that would otherwise pass can't be analyzed and fails.

[INFO] [00:00:03.630]分析/mySuperProject/target/jacoco.exec-> java.io.IOException:版本1007不兼容

[INFO] [00:00:03.630] Analysing /mySuperProject/target/jacoco.exec -> java.io.IOException: Incompatible version 1007

当我使用调试开关调用maven build时,这个原因就被揭示了

When I invoke maven build with debug switch, this cause is revealed

Caused by: java.io.IOException: Incompatible version 1007.
at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127)
at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)
at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:134)
at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:107)

在检查jacoco ExecutionDataReader时,我发现从

While inspecting jacoco ExecutionDataReader, I found that exception is thrown from

if (version != ExecutionDataWriter.FORMAT_VERSION) {
    throw new IOException(format("Incompatible version %x.",Integer.valueOf(version)));
}

并从ExecutionDataWriter中找到

and from ExecutionDataWriter I've found out

/** File format version, will be incremented for each incompatible change. */
public static final char FORMAT_VERSION = 0x1007;

这是什么不兼容的更改,为什么会发生? 有什么想法可以解决这个挑战吗?

What is this incompatible change and why does it happen? Any ideas how to fix this challenge?

推荐答案

如前所述,这是由于JaCoCo maven插件代码中的一个中断. 您可以(临时)在jenkins maven命令中指定版本,例如:

As already mentioned, this is due to a break in JaCoCo maven plugin code. You can (temporarily) specify the version in your jenkins maven command like:

clean org.jacoco:jacoco-maven-plugin:<version>:prepare-agent install

例如

clean org.jacoco:jacoco-maven-plugin:0.7.4.201502262128:prepare-agent install

这是对我们有帮助的解决方法.但是像大多数人一样,我仍然在等待修复程序的出现.

This was the workaround that helped us. But like most people, I'm still waiting for the fix to come.

这篇关于JaCoCo SonarQube不兼容版本1007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆