Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用仅报告目标将maven surefire报告插件集成到maven站点插件中_Java_Maven_Pom.xml_Maven Surefire Plugin_Maven Site Plugin - Fatal编程技术网

Java 如何使用仅报告目标将maven surefire报告插件集成到maven站点插件中

Java 如何使用仅报告目标将maven surefire报告插件集成到maven站点插件中,java,maven,pom.xml,maven-surefire-plugin,maven-site-plugin,Java,Maven,Pom.xml,Maven Surefire Plugin,Maven Site Plugin,我有以下问题: maven surefire报告插件调用生命周期目标test。这将再次启动我的testrunner。为了防止这种情况发生,他们采取了以下变通办法: 我现在在将其应用到我的POM中时遇到了困难。 他们在页面上有以下注释: 注意:从2.8版开始,该插件需要Maven站点插件2.1或更高版本 更高的温度可以正常工作。版本2.7.2和更高版本仍然兼容 使用较新的surefire版本,因此可以进行混合 我的maven运行:“清理部署站点部署” 这是我的POM部分: org.apache

我有以下问题:

maven surefire报告插件调用生命周期目标
test
。这将再次启动我的testrunner。为了防止这种情况发生,他们采取了以下变通办法:

我现在在将其应用到我的POM中时遇到了困难。 他们在页面上有以下注释:

注意:从2.8版开始,该插件需要Maven站点插件2.1或更高版本 更高的温度可以正常工作。版本2.7.2和更高版本仍然兼容 使用较新的surefire版本,因此可以进行混合

我的maven运行:“清理部署站点部署”

这是我的POM部分:


org.apache.maven.plugins
maven站点插件
org.apache.maven.plugins
maven项目信息报告插件
2.7
假的
假的
指数
依赖关系
项目组
org.apache.maven.plugins
maven surefire报告插件
2.9
${project.build.directory}/site
${project.build.directory}/site/surefire报告
org.apache.maven.plugins
maven jxr插件
2.3
真的
UTF-8
UTF-8

我如何配置它,使其仅触发
surefire report:report only
,并且不调用
测试
-阶段(但所有其他操作都在
站点
-阶段完成)?

在搜索internet几个小时后,我终于找到了方法

目标必须是报告,如下所示:

<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>

org.apache.maven.plugins
maven surefire报告插件
2.9
${project.build.directory}/site
${project.build.directory}/site/surefire报告
集成测试
仅报告

也适用于我!它也可以在没有集成测试的情况下运行,我也不需要
部分(因为我没有更改默认目录)。