плагин maven-surefire-report-plugin не генерирует surefire-report.html - PullRequest
5 голосов
/ 22 февраля 2012

Я не могу получить 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
Кроме того, папка site создается с css и images папка и содержимое, но без отчета.

Ответы [ 2 ]

6 голосов
/ 22 февраля 2012

В JIRA есть похожие проблемы, решение состоит в том, чтобы использовать более позднюю версию maven-site-plugin 3.0-x в вашем pom.xml:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-site-plugin</artifactId>
      <version>3.3</version>
    </plugin>
    ...
  </plugins>
</build>
3 голосов
/ 27 января 2016

После завершения работы тестовых сценариев вы можете CMD mvn surefire-report: report-only для генерации отчета о тестировании

...