我的任务有问题
:jacocoTestReport
。 gradle clean build
我的 Gradle Java 项目 (Spring Boot) 的任务因错误而失败:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jacocoTestReport'.
> java.lang.IllegalArgumentException: malformed input off : 17, length : 1
我的测试资源和资源文件夹中有
chcp1251
存档文件:
我认为这是 jacoco 任务失败的原因,但我不确定。这是我的
build.gradle
文件:
plugins {
id "java"
id "idea"
id "groovy"
id "jacoco"
...
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
html.enabled false
xml.enabled true
}
}
你能帮我解决这个问题吗?也许我不能为 jacoco 设置字符集?
jacoco 不支持
UTF-8
中的编码。我使用没有空格和西里尔符号的新名称在测试资源文件夹中重新创建了我的存档。它工作正常。