4

I want to aggregate all surefire reports in separate modules. In my folder there are several module and I want to generate aggregated surefire report of all those modules. I could do this when I execute following command inside the my parent folder.

mvn surefire-report:report -Daggregate=true

I want to do the same operation when I execute

mvn clean install

inside my parent folder. For that I have to change the parent folder pox.xml file.

I found it can be using following maven plugin

<build>
    <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.7.2</version>
                <configuration>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
            ...............

But when I execute

mvn clean install 

There is no result. In addition to add the plugin to the pom.xml is there any other steps to do ? Or is this path correct ?

Thanks,

Malintha
  • 4,512
  • 9
  • 48
  • 82
  • Related: [Generating html surefire test html output during test phase](https://stackoverflow.com/questions/4053474/generating-html-surefire-test-html-output-during-test-phase) – Vadzim Sep 14 '19 at 09:22

1 Answers1

9

try this

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.7.2</version>
            <configuration>
                <aggregate>true</aggregate>
            </configuration>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275