https://issues.apache.org/jira/browse/SUREFIRE-753

Here the pom.xml snippet how i configured the report-plugin:

      <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.9</version>
<configuration>
<outputName>failsafe-report</outputName>
<reportsDirectories>
<reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
</reportsDirectories>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>

This means the name of the link in the navigation must be changed as well. May be it's needed to have a supplemental configuration parameter for this or the outputName could be used instead.

maven-surefire-plugin是maven默认的test执行器。而maven-surefire-report-plugin是site生成test报表的一个插件。maven-surefire-report-plugin默认目标是report,这个将告诉maven执行test,然后搜集surefire-reports下xml生成报告。 而默认mvn site也会执行一次test。所以造成执行两次,解决办法:

< plugin >
  < groupId >org.apache.maven.plugins< /groupId >
  < artifactId >maven-surefire-report-plugin< /artifactId >
  < version >2.7< /version >
  < reportSets >
    < reportSet >
    < reports >
      < report >report-only< /report >
    < /reports >
    < /reportSet >
  < /reportSets >
< /plugin >

将其目标更改report-only,则告诉报表插件,自己不用执行test了,直接使用生命周期里test的执行 surefire-reports结果。bug新颁布已经解决了。

【转】maven同时使用maven-surefire-report-plugin和maven-surefire-plugin默认将执行两次test的更多相关文章

  1. Maven提高篇系列之(二)——配置Plugin到某个Phase(以Selenium集成测试为例)

    这是一个Maven提高篇的系列,包含有以下文章: Maven提高篇系列之(一)——多模块 vs 继承 Maven提高篇系列之(二)——配置Plugin到某个Phase(以Selenium集成测试为例) ...

  2. maven报错【Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of】

    [自己的操作] (1)windows -> Preferences -> maven 的settings.xml文件中.m2的位置已经失效,更改正确后尝试 (2)pom.xml还有下面错误 ...

  3. maven系列(2)-第一个maven的项目

    上一篇简单了介绍了maven和maven的安装,这篇介绍如何用maven创建项目. 1. 命令行创建maven项目 maven创建项目很简单,直接调用mvn archetype:generate命令即 ...

  4. Spark之路 --- Scala IDE Maven配置(使用开源中国的Maven库)和使用

    为什么要使用Maven 摘自百度百科的介绍 Maven是基于项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具.Maven 除了以程序构建能力为特色之外,还提 ...

  5. eclipse 创建maven 项目 动态web工程完整示例 maven 整合springmvc整合mybatis

    接上一篇: eclipse 创建maven 项目 动态web工程完整示例 eclipse maven工程自动添加依赖设置 maven工程可以在线搜索依赖的jar包,还是非常方便的 但是有的时候可能还需 ...

  6. maven(二):创建一个可用的maven项目,完整过程

    环境:eclipse4.5 (内置maven插件) 创建maven项目 文件菜单--新建--其他-- maven project 下一步 选择web 结构 group id:  指项目在maven本地 ...

  7. (转)Maven学习总结(七)——eclipse中使用Maven创建Web项目

    孤傲苍狼只为成功找方法,不为失败找借口! Maven学习总结(七)——eclipse中使用Maven创建Web项目 一.创建Web项目 1.1 选择建立Maven Project 选择File -&g ...

  8. Maven 使用了一个标准的目录结构和一个默认的构建生命周期。

    Maven 使用了一个标准的目录结构和一个默认的构建生命周期. 约定优于配置 当创建 Maven 工程时,Maven 会创建默认的工程结构.开发者只需要合理的放置文件,而在 pom.xml 中不再需要 ...

  9. Maven学习一:使用Myeclipse创建Maven项目

    使用Myeclipse2014创建Maven项目有如下几种方式: 1.创建Maven Java项目 1.1 选择新建Maven项目 1.2.选择创建简单项目 1.3.填写项目信息 1.4.创建成功后项 ...

随机推荐

  1. 【Unity】AssetBundle的使用——打包/解包

    最近参考了各位大神的资源,初步学习了Unity的资源管理模式,包括在编辑器管理(使用AssetDatabase)和在运行时管理(使用Resources和AssetBundle).在此简单总结运行时用A ...

  2. u-boot的配置

    1 sama5d31dk           sama5d3_xplained:SAMA5D3,SYS_USE_NANDFLASH                                    ...

  3. Linux下架构高可用性网络----HA+LB+lvs

    实验总拓扑: IP规划: Director1:     eth0      192.168.10.136/28 eth1      192.168.11.2/24 Director2:     eth ...

  4. Repeater 嵌套,子级Repeater获取 父级Repeater 中的值

    第一种方法,子级Repeater中绑定父级的某个字段: <%# DataBinder.Eval((Container.NamingContainer.NamingContainer as Rep ...

  5. eclipse如何设置高亮代码的背景色,比如选中某个单词,高亮所有的

    设置方法如下: 1.单击IDE顶部Window菜单下的Prefences,如图: 2.在打开对话框的左侧树上,找到Java节点下的Editor中的Mark Occurren,如图: 3.点击Mark ...

  6. QDateTime 本地时间和UTC时间转换问题

    先说一下UTC,搜索360百科: 协调世界时,又称世界统一时间.世界标准时间.国际协调时间,简称UTC,是以原子时秒长为基础,在时刻上尽量接近于世界时的一种时间计量系统.1979年12月3日在内瓦举行 ...

  7. Q_UNUSED() 方法的使用

    Q_UNUSED() 没有实质性的作用,用来避免编译器警告 //比如说 int testFunc(int a, int b, int c, int d) { int e; return a+b+c; ...

  8. git之移除.idea

    有时候不小心提交了.idea目录,git会一直track这个目录,可以通过一下命令移除: mv .idea ../.idea_backup rm -r .idea git rm -r .idea gi ...

  9. 解决git pull 每一次都需要输入密码的问题

    方法1: 当我们配置好我们的git以后呢,我们可以在配置文件~/.gitconfig 或 ~/.config/git/config 文件里加入这么两行: [credential] helper = s ...

  10. 用OpenGL进行立方体表面纹理贴图

    一.目的 掌握OpenGL中纹理对象的创建.绑定与使用方法. 二.简单介绍 1,连接静态库 #pragma comment(lib, "glut32.lib") #pragma c ...