JaCoCo 报告生成中发生错误
2022-09-03 13:50:48
我目前正在尝试添加JaCoCo作为我的spring boot maven项目的依赖项,以查看我的单元测试的代码覆盖率。但是,当我运行测试时,它失败并出现错误。
Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:report (report) on project test-rest-service: An error has occurred in JaCoCo report generation. Error while creating report: malformed input around byte 2 -> [Help 1]
所有测试都通过而没有失败,所以这不是问题。
JaCoCo 的依赖关系是:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
JaCoCo.exec 文件已生成,但我无法打开它来生成报告。我做错了什么?