Question

I have the following issue:

The maven-surefire-report-plugin invokes the lifecycle goal test. This starts my testrunner again. To prevent this, they made this workaround: http://jira.codehaus.org/browse/SUREFIRE-257

I am now encountering difficulties implementing this into my POM. They have the following note on the page:

Note: As of version 2.8 this plugin requires Maven Site Plugin 2.1 or higher to work properly. Version 2.7.2 and older are still compatible with newer surefire versions, so mixing is possible.

My maven runs: "clean deploy site-deploy"

This is my POM part:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
        <reportPlugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>dependencies</report>
                            <report>project-team</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <outputDirectory>${project.build.directory}/site</outputDirectory>
                    <reportsDirectories>
                        <reportsDirectories>${project.build.directory}/site/surefire-reports</reportsDirectories>
                    </reportsDirectories>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.3</version>
            </plugin>
        </reportPlugins>
        <generateReports>true</generateReports>
        <inputEncoding>UTF-8</inputEncoding>
        <outputEncoding>UTF-8</outputEncoding>
    </configuration>
</plugin>

How do I configure it that only surefire-report:report-only is triggered and the test-phase is not invoked (but do everything else is done in site-phase)?

Was it helpful?

Solution

After searching the internet for a few hours and some things I finally found out how.

The goal has to be the report, like this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-report-plugin</artifactId>
    <version>2.9</version>
    <configuration>
        <outputDirectory>${project.build.directory}/site</outputDirectory>
        <reportsDirectories>
            <reportsDirectories>${project.build.directory}/site/surefire-reports</reportsDirectories>
        </reportsDirectories>
    </configuration>
    <reportSets>
        <reportSet>
            <id>integration-tests</id>
            <reports>
                <report>report-only</report>
            </reports>
        </reportSet>
    </reportSets>
</plugin>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top