我有以下问题:
maven-surefire-report-plugin 调用生命周期目标test
。这再次启动我的测试运行程序。为了防止这种情况,他们采取了以下解决方法:
http://jira.codehaus.org/browse/SUREFIRE-257
我现在在将其实现到我的 POM 中时遇到困难。 他们在页面上有以下注释:
Note: As of version 2.8 this plugin requires Maven Site Plugin 2.1 or higher to work properly. Version 2.7.2 and older are still compatible with newer surefire versions, so mixing is possible.
我的 Maven 运行:“clean deploy site-deploy”
这是我的 POM 部分:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>dependencies</report>
<report>project-team</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.9</version>
<configuration>
<outputDirectory>${project.build.directory}/site</outputDirectory>
<reportsDirectories>
<reportsDirectories>${project.build.directory}/site/surefire-reports</reportsDirectories>
</reportsDirectories>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</reportPlugins>
<generateReports>true</generateReports>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
如何将其配置为仅触发 surefire-report:report-only
并且不调用 test
阶段(但其他所有操作均在 站点
-阶段)?
最佳答案
在互联网上搜索了几个小时和一些东西后,我终于找到了方法。
目标必须是报告,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.9</version>
<configuration>
<outputDirectory>${project.build.directory}/site</outputDirectory>
<reportsDirectories>
<reportsDirectories>${project.build.directory}/site/surefire-reports</reportsDirectories>
</reportsDirectories>
</configuration>
<reportSets>
<reportSet>
<id>integration-tests</id>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
关于java - 如何使用仅报告目标将 maven-surefire-report-plugin 集成到 maven-site-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23653625/