2
我目前正在嘗試使用Maven和TestNG運行Jacoco。Jacoco,Maven&TestNG(0測試覆蓋率)
我還沒有下載/安裝任何東西。
我試着添加以下到我的父POM(也嘗試添加到測試包POM,但仍沒有結果)
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.3.201306030806</version>
<configuration>
<destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
<datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
當我做「MVN全新安裝」或MVN包輸出作爲「測試輸出」出現在根文件夾中。我試着在Maven中設置「outputDirectory」,但這沒有任何作用。
我遇到的另一個更大的問題是它沒有拿起任何testNG測試。代碼覆蓋率爲0.
有人可以幫忙嗎?