无法使用Gradle 4.5将jacoco报告上载到TeamCity [英] Unable to upload jacoco report to TeamCity with Gradle 4.5
问题描述
我有一个Gradle任务,可将Jacoco报道上载到TeamCity(在此处遵循TeamCity文档:
I have a Gradle task to upload jacoco coverage to TeamCity (following TeamCity documentation here: Importing JaCoCo coverage data to TeamCity):
task uploadJacocoTestReport {
doLast {
println "##teamcity[jacocoReport dataPath='build/jacoco/jacocoTest.exec' " +
"includes='com.mypackage.*' " +
"classpath='build/classes/main']"
}
}
如果我使用Gradle 3.5
,TeamCity构建可以在构建日志中显示CodeCoverage报告.但是,当我切换到Gradle 4.5
时,代码覆盖率"部分将不再出现在构建日志中.如何使用Gradle 4.5上传jacoco报告?
If I use Gradle 3.5
, TeamCity build is able to display CodeCoverage report in the build log. But when I switch to Gradle 4.5
, the Code Coverage section no longer appears in the build log. How do I upload jacoco report with Gradle 4.5?
TeamCity版本10.0.5 (build 42677)
TeamCity version 10.0.5 (build 42677)
jacoco版本0.8.0
推荐答案
我在teamcity上遇到了同样的问题,并向我显示了下一条消息:
I had same problem with teamcity and it printed me next message:
[Generating JaCoCo coverage...] JaCoCo report generation failed. Exit code: 1
尝试使用:
println "##teamcity[jacocoReport dataPath='$project.buildDir/jacoco/jacocoTest.exec' ...]"
实例:
println "##teamcity[jacocoReport dataPath='build/jacoco/jacocoTest.exec' ...]"
这篇关于无法使用Gradle 4.5将jacoco报告上载到TeamCity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!