1. 執(zhí)行jacoco報錯:Malformed \uxxxx encoding.
【問題描述】
執(zhí)行命令報錯Malformed \uxxxx encoding.
mvn clean verify jacoco:report -V -T 2 -DforkCount=2 -DreuseForks=true -Dmaven.test.skip=false
【解決方案】
find ~/.m2/ -name resolver-status.properties -delete
【參考】
https://stackoverflow.com/questions/17043037/ant-malformed-uxxxx-encoding-in-propertyfile-task
2. jacoco沒有生成單側(cè)報告
【問題描述】
正常情況下如果執(zhí)行命令欠气,會生成相關(guān)的jacoco報告哭廉,打開index.html后就可以看到單測覆蓋報告了
mvn clean verify jacoco:report -V -T 2 -DforkCount=2 -DreuseForks=true -Dmaven.test.skip=false
image.png
【問題解決】
發(fā)現(xiàn)沒有添加如下依賴麦萤,添加后就可以生成單側(cè)報告了
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
【參考】
junit-vintage-engine介紹:https://mvnrepository.com/artifact/org.junit.vintage/junit-vintage-engine