maven surefire报告插件未生成surefire-report.html

maven surefire报告插件未生成surefire-report.html,maven,maven-2,maven-surefire-plugin,Maven,Maven 2,Maven Surefire Plugin,运行以下命令时,我无法使用maven surefire report插件生成surefire report.html: mvn clean deploy site mvn clean site mvn site mvn clean install site mvn surefire-report:report 我唯一能够生成报告的时间是在运行以下命令时: mvn clean deploy site mvn clean site mvn site mvn clean install site

运行以下命令时,我无法使用maven surefire report插件生成surefire report.html

mvn clean deploy site
mvn clean site
mvn site
mvn clean install site
mvn surefire-report:report
我唯一能够生成报告的时间是在运行以下命令时:

mvn clean deploy site
mvn clean site
mvn site
mvn clean install site
mvn surefire-report:report
下面是我的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>blah.blah</groupId>
    <artifactId>build</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>build</name>
    <description>build</description>

    <properties>
        ...
    </properties>

    <modules>
        <module>../report</module>
    </modules>

    <dependencyManagement>
        <dependencies>
        ...
            <!-- Custom local repository dependencies -->
            <dependency>
                <groupId>asm</groupId>
                <artifactId>asm-commons</artifactId>
                <version>3.1</version>
            </dependency>
        ...
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                ...
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-Xmx1024m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Dsun.lang.ClassLoader.allowArraySyntax=true</argLine>
                    <includes>
                        <include>**/*Test.java</include>
                        <include>**/*_UT.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*_IT.java</exclude>
                        <exclude>**/*_DIT.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.7.2</version>
            </plugin>
        </plugins>
    </reporting>
</project>

4.0.0
废话
建造
0.0.1-快照
聚甲醛
建造
建造
...
../报告
...
asm
公共空间
3.1
...
...
org.apache.maven.plugins
maven surefire插件
-Xmx1024m-XX:MaxPermSize=256m-XX:-usegcoveredlimit-Dsun.lang.ClassLoader.Allowarray语法=true
**/*Test.java
**/*_UT.java
**/*_IT.java
**/*_java
org.apache.maven.plugins
maven surefire报告插件
2.7.2
我的项目中有两个测试,TEST-*.xml文件在surefire报告中生成

此外,站点文件夹是使用css和images文件夹和内容生成的,但没有报告。

中报告了类似的问题,解决方案是在pom.xml中使用maven site plugin 3.0-x的更高版本:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-site-plugin</artifactId>
      <version>3.3</version>
    </plugin>
    ...
  </plugins>
</build>

org.apache.maven.plugins
maven站点插件
3.3
...

测试用例运行完成后,您可以CMD mvn surefire report:report only生成测试报告

您使用的maven版本是什么?
3.0
版本不再是beta版。如果希望使用最新版本的maven site plugin,可以指定
3.0
,然后选中。截至今天(2013年3月12日),最新版本为3.2。因此,应包含在工作设置目标中的目标名称为surefire report:report only