7

I'm using maven-surefire-report-plugin in order to generate the unit tests report. This is working fine however the report contains links to images which are not presented. How can I make maven copy the icons required for the report? Should I use skin? I tried it without success. Here is the maven-surefire-report-plugin definition:

 <reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.16</version>
            <configuration>
                <showSuccess>true</showSuccess>
            </configuration>
        </plugin>

    </plugins>
</reporting>

I tried to add skin plugin but it didn't affect the report:

 <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-site-plugin</artifactId>
       <dependencies>
           <dependency>
               <groupId>org.apache.maven.skins</groupId>
               <artifactId>maven-application-skin</artifactId>
               <version>1.0</version>
           </dependency>
       </dependencies>
 </plugin>

What is missing to present the report with the images?

Nava Polak Onik
  • 1,509
  • 2
  • 13
  • 17

4 Answers4

23

The question is probably too old, but I had the same problem and I found this answer. The command mvn site -DgenerateReports=false generates only css and images for surefire-report.html and works fine.

Community
  • 1
  • 1
newtester
  • 246
  • 3
  • 3
2

You must genereate the site using the Site Plugin:

mvn site

If you have already generated the reports, then you can speed this up by skipping this:

mvn site -DgenerateReports=false
Attila
  • 3,206
  • 2
  • 31
  • 44
1

mvn site -DgenerateReports=false

-1

I did it like this, but it's a hack:

<build>
    <plugins>
        ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire.version}</version>
            <configuration>
                <testSourceDirectory>src/test/java</testSourceDirectory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>${maven-surefire.version}</version>
            <configuration>
                <linkXRef>false</linkXRef>
                <showSuccess>true</showSuccess>
            </configuration>
            <executions>
                <execution>
                    <id>generate-test-report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>${project.basedir}/src/test/resources/css</directory>
            <targetPath>${project.build.directory}/site/css</targetPath>
            <includes>
                <include>*.css</include>
            </includes>
        </resource>
    </resources>
</build>
djangofan
  • 28,471
  • 61
  • 196
  • 289