运行mvn jacoco:report
后如何在控制台上打印覆盖百分比?
我可以在浏览器中看到它,但希望它以jenkins打印。
答案 0 :(得分:2)
我用以下命令得到它:
awk -F, \
'{ instructions += $4 + $5; covered += $5 } END \
{ print covered, "/", instructions, " instructions covered"; \
print 100*covered/instructions, "% covered" }' \
target/site/jacoco/jacoco.csv