maven-surefire-report-plugin not generating surefire-report.html
Asked Answered
H

2

7

I'm unable to get the maven-surefire-report-plugin to generate the surefire-report.html when I run:

mvn clean deploy site
mvn clean site
mvn site
mvn clean install site

The only time I've been able to get the report generated is when I run:

mvn surefire-report:report

Here is a look at my 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>

There are 2 tests in my project and TEST-*.xml files are generated in surefire-reports
Also, the site folder is generated with a css and images folder and contents, but no report.

Helsa answered 21/2, 2012 at 23:39 Comment(1)
What is the maven version you are using?Triphammer
T
7

There is a similar issues reported in JIRA, the solution is to use later version of maven-site-plugin 3.0-x in your pom.xml:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-site-plugin</artifactId>
      <version>3.3</version>
    </plugin>
    ...
  </plugins>
</build>
Triphammer answered 22/2, 2012 at 2:49 Comment(2)
3.0 version is no longer beta. You can specify <version>3.0</version>Merari
If you wish to use the latest version of maven-site-plugin, then check this. As of today (12 March 2013) the latest version is 3.2.Armorer
G
7

After testcases running finished, you can CMD mvn surefire-report:report-only to generate test report

Galliwasp answered 27/1, 2016 at 3:17 Comment(1)
So the name of the goal which should be included to job settings goals is surefire-report:report-onlyGlasgo

© 2022 - 2024 — McMap. All rights reserved.