6

実行時にmaven-surefire-report-pluginを取得してsurefire-report.htmlを生成できません:

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>

私のプロジェクトには2つのテストがあり、TEST-*.xmlファイルはsurefire-reports
で生成されます。 また、サイトフォルダーはcssimagesフォルダーとコンテンツで生成されますが、レポートはありません。

4

2 に答える 2

6

JIRAで同様の問題が報告されています。解決策は、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>
于 2012-02-22T02:49:38.187 に答える
6

テストケースの実行が終了したら、CMD mvn Surefire-report:report-only でテスト レポートを生成できます。

于 2016-01-27T03:17:36.683 に答える