mr_*_*owl 5 java testng maven jacoco
我目前正在尝试使用 Maven 和 TestNG 运行 Jacoco。
我还没有下载/安装任何东西。
我尝试将以下内容添加到我的父 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>
Run Code Online (Sandbox Code Playgroud)
当我执行“mvn clean install”或 mvn package 时,输出将作为“test-output”出现在根文件夹中。我尝试在 Maven 中设置“outputDirectory”,但这没有任何作用。
我遇到的另一个更大的问题是它没有进行任何 testNG 测试。代码覆盖率为0。
有人可以帮忙吗?
<MyClass>Test?@Test(对您来说很明显)。但请确保指定public访问器。| 归档时间: |
|
| 查看次数: |
2931 次 |
| 最近记录: |