Configure surefire report for maven multi-module project

100 Views Asked by At

I need to configure an agregate surefire report about unit test results in a maven multi- module project (9 submodules). I have tried to use this solution, but in the parent report only one module is included, for others result I have to open them from each module. Here is my parent pom config: `

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.1.2</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<reporting>
    <outputDirectory>${basedir}/target/site</outputDirectory>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.4.2</version>
            <reportSets>
                <reportSet>
                    <reports>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.1.2</version>
                <reportSets>
                    <reportSet>
                        <!-- defines aggregate unit test report -->
                        <id>unit-tests-aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>report</report>
                        </reports>
                        <configuration>
                            <aggregate>true</aggregate>
                        </configuration>
                    </reportSet>

                    <reportSet>
                        <!-- defines aggregate integration test report -->
                        <id>integration-tests-aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>failsafe-report-only</report>
                        </reports>
                        <configuration>
                            <aggregate>true</aggregate>
                        </configuration>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.3.0</version>
            </plugin>
        </plugins>
    </reporting>`

Can you help me please to understand what can be the problem here? Maybe I have to add some configurations to submodules also? I expect to see all tests results from all modules in the parent report

0

There are 0 best solutions below