How to get the icons for the resulted maven-surefire-report-plugin
Asked Answered
F

4

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?

Fantinlatour answered 29/1, 2014 at 13:34 Comment(2)
Can you show an example report which does not fit your needs?Shalne
The report is fine. it just don't show the linked images. for example: icon_error_sml.gif icon_success_sml.gifFantinlatour
U
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.

Utimer answered 11/3, 2015 at 16:31 Comment(0)
K
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
Kapok answered 5/5, 2021 at 7:33 Comment(0)
P
1

mvn site -DgenerateReports=false

Platino answered 21/12, 2021 at 7:51 Comment(0)
D
-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>
Durative answered 30/11, 2019 at 3:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.