Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven-surefire-report-plugin not generating surefire-report.html

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.

like image 994
anztenney Avatar asked Feb 21 '12 23:02

anztenney


People also ask

Which command is used for generating unit test reports Maven surefire report Maven surefire report report Maven surefire Report Report Mvn surefire report?

The Maven unit test reports are generated by the Maven Surefire plugin. Therefore a unit test report is also some times referred to as surefire report.

Why tests are skipped Maven surefire plugin?

When the Surefire plugin reaches the test goal, it will skip the unit tests if the maven. test. skip properties is set to true . Another way to configure Maven to skip unit tests is to add this configuration to your project's pom.

How do I check my surefire report?

We can run the tests of a project using the surefire plugin. By default, this plugin generates XML reports in the directory target/surefire-reports. This plugin has only one goal, test. This goal is bound to the test phase of the default build lifecycle, and the command mvn test will execute it.


1 Answers

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>
like image 51
yorkw Avatar answered Nov 08 '22 15:11

yorkw