【问题标题】:How to generate surefire-report.html using eclipse如何使用eclipse生成surefire-report.html
【发布时间】:2016-06-22 02:06:29
【问题描述】:

我想知道如何使用 eclipse 生成surefire-report.html。我创建了一个项目,并且能够在文本文件中创建报告

看看我的 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0     http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.company</groupId>
  <artifactId>mymaven</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>mymaven</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
 <dependencies>
 <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.5</version>
  <scope>test</scope>
    </dependency>    
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-remote-control</artifactId>
    <version>1.0.1</version>
    <type>pom</type>
    </dependency>    
    <dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-report-plugin</artifactId>
    <version>2.5</version>
    <type>maven-plugin</type>
    </dependency>  
     </dependencies> 
    <reporting>
    <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-report-plugin</artifactId>
    <version>2.5</version>
    <configuration>
      <outputName>GoogleSearchTestResults</outputName>                   
    </configuration>
  </plugin>
</plugins>
  </reporting>    
</project>

如果您能提供帮助,不胜感激。

谢谢

【问题讨论】:

  • 使用 maven 插件作为依赖是完全错误的。除此之外,您使用的是古老版本的 Maven-surefire-plugin...

标签: java maven pom.xml maven-surefire-plugin maven-site-plugin


【解决方案1】:

包含此报告插件

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

执行目标 -

test -Dmaven.test.failure.ignore=true site

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-14
    • 2012-07-29
    • 2021-12-13
    • 2014-12-25
    • 1970-01-01
    • 2017-02-05
    • 1970-01-01
    • 2023-03-21
    相关资源
    最近更新 更多