我们有如下布局的项目
核心模块中有cobertura插件。我能够从命令行生成报告--完全没有问题(XML和HTML) --我甚至能够在Jenkins的工作区中看到它们。然而,我无法将这些报告与Jenkins Cobertura插件联系起来。默认情况下,如Jenkins文档所示
**/target/site/cobertura/coverage.xml这是因为在子模块中生成的报告不起作用。我试着跟着
core/target/site/cobertura/coverage.xml
/core/target/site/cobertura/coverage.xml
**/core/target/site/cobertura/coverage.xml发布于 2012-08-13 12:07:20
好吧,问题是我用cobertura插件作为
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<formats>
<format>xml</format>
<format>html</format>
</formats>
</configuration>
</plugin>
</plugins>
</pluginManagement>相反,它应该是
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<formats>
<format>xml</format>
<format>html</format>
</formats>
<check/>
</configuration>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
</plugin>
</plugins>
</reporting>之后,我将Jenkins Cobertura插件指向core/target/site/cobertura/coverage.xml。
发布于 2014-06-05 09:08:51
在应用程序目标中添加以下行:(在jenkins中配置应用程序的部分)
cobertura:cobertura -Dcobertura.report.format=xmlCobertura xml报告模式:
*/target/site/cobertura/.xml
pom.xml更改:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
</plugin>
</plugins>
https://stackoverflow.com/questions/11594050
复制相似问题