我对代码和战争文件进行了检测,成功部署到了 tomcat 容器中。
我正在对它运行我的客户端测试。在成功运行测试后,当我关闭我的 tomcat 实例时,在 tomcat 的 bin 目录中有 Cobertura.ser 文件。
Cobertura.ser 文件包含代码覆盖文件的所有详细信息。
现在,我想配置一个 maven 任务以从 .ser 文件生成 Cobertura html 报告。
我阅读了 Cobertura-maven-plugin 的帮助指南,但无法正确理解。
(我没有运行 junit 测试,但我正在执行 selenium 测试)。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>instrument-code</id>
<phase>package</phase>
<goals>
<goal>instrument</goal>
</goals>
<configuration>
<attach>true</attach>
</configuration>
</execution>
<execution>
<id>generate-report</id>
<phase>prepare-package</phase>
<goals>
<goal>cobertura</goal>
</goals>
<configuration>
<dataFile>C:\Servers\apache-tomcat-8.0.11\bin\cobertura.ser</dataFile>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<outputDirectory>C:\Users\satyam\report</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
这是我对 Cobertura-plugin 的 maven 配置,但这样 maven 不会从位于 tomcat bin 目录中的 Cobertura.ser 文件生成报告。