項目結構:日食 - 爪哇 - 搖籃被跳過jacocoTestReport
src/main/java
src/main/resources
src/test/java
搖籃版本:2.2.1
這裏是我的build.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
version = '1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7
test {
include 'src/test/java'
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = "0.7.6.201602180812"
}
jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/reports/jacoco/html"
}
}
當我運行gradle這個任務, 「test jacocoTestReport」,我得到下面的結果
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:jacocoTestReport SKIPPED
有人可以請建議應該添加什麼來執行jacoco測試報告。
謝謝。