Java 如何获取html格式的Maven报告?

Java 如何获取html格式的Maven报告?,java,maven,Java,Maven,我有一个带有eclipse的maven项目和一些selenium测试。 我可以在命令行中运行它们,并在目标文件夹中以txt和xml格式获得报告 但是我想要html格式的报告。 我应该在POM文件中添加什么 多谢各位 这是我的POM.xml .... <dependencies> <dependency> <groupId>junit</groupId> <artifactId&g

我有一个带有eclipse的maven项目和一些selenium测试。 我可以在命令行中运行它们,并在目标文件夹中以txt和xml格式获得报告

但是我想要html格式的报告。 我应该在POM文件中添加什么

多谢各位

这是我的POM.xml

....
<dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itextpdf</artifactId>
    <version>5.5.3</version>
</dependency>

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0</version>
</dependency>

 <dependency>
     <groupId>javax.mail</groupId>
     <artifactId>mail</artifactId>
     <version>1.4.3</version>
    </dependency>

    </dependencies>



    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

        <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.4</version>
    <executions>
        <execution>
            <id>copy</id>
            <phase>package</phase>
        </execution>
    </executions>
</plugin>
        </plugins>
    </build>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

</project>
。。。。
朱尼特
朱尼特
4.11
测试
org.seleniumhq.selenium
硒爪哇
2.44.0
com.itextpdf
itextpdf
5.5.3
com.oracle
ojdbc6
11.2.0
javax.mail
邮件
1.4.3
org.apache.maven.plugins
maven编译器插件
2.3.2
1.6
1.6
org.apache.maven.plugins
maven依赖插件
2.4
复制
包裹
UTF-8
请参见,正如第二个答案所指出的,您应该能够使用Maven

Surefire报告插件解析${basedir}/target/Surefire报告下生成的TEST-*.xml文件,并使用DOXIA呈现这些文件,DOXIA将创建测试结果的web界面版本

以下是配置它的XML:

<reporting>
 <plugins>

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-report-plugin</artifactId>
    <version>2.18</version>
  </plugin>

 </plugins>
</reporting>

org.apache.maven.plugins
maven surefire报告插件
2.18
以下任一命令将调用它:

  • mvn站点
  • mvn surefire报告:报告

1。这与eclipse有什么关系?2.在众多Maven报告中,你在寻找哪一份?3.永远不要使用java.net存储库。我需要html格式的基本报告结果。我知道没有“基本报告”这样的东西。当您运行“mvn site:site”时,您将根据POM的reporting元素中的内容,以HTML格式选择报告。我希望以HTML格式报告项目的测试结果,实际上我有txt和xml格式的,我想要这样的东西,但这是Ant的Build.xml文件