首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用纯报表目标将maven-surefire-report-plugin集成到maven-site-plugin中

如何使用纯报表目标将maven-surefire-report-plugin集成到maven-site-plugin中
EN

Stack Overflow用户
提问于 2014-05-14 11:37:29
回答 1查看 4.9K关注 0票数 2

我有以下问题:

maven-尽是火-报告插件调用生命周期目标test。这又开始了我的发情者。为了防止这种情况,他们做了这样的解决方案:http://jira.codehaus.org/browse/SUREFIRE-257

在我的POM中,我现在遇到了执行这个问题的困难。在这一页上有以下说明:

注意:从2.8版开始,这个插件需要Maven站点插件2.1或更高版本才能正常工作。版本2.7.2和更高版本仍然兼容较新的保险火版本,因此混合是可能的。

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

这是我的POM部分:

代码语言:javascript
复制
<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-phase (但是其他一切都是在site-phase中完成的)?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-14 12:15:39

在互联网上搜索了几个小时和一些东西之后,我终于找到了答案。

目标必须是报告,就像这样:

代码语言:javascript
复制
<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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23653625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档