Search code examples
mavenantmaven-failsafe-plugin

Issue with an ant-style pattern include and the maven-failsafe-plugin


I am desperately trying to get the maven failsafe plugin to run my integration tests.

I have configured the plugin as follows:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.16</version>
        <executions>
            <execution>
                <id>failsafe-itest</id>
                <phase>integration-test</phase>
                <goals>
                    <goal>integration-test</goal>
                </goals>
                <configuration>
                    <skip>false</skip>
                    <includes>
                        <include>**/integration/**</include>
                    </includes>
                </configuration>
            </execution>
        </executions>
    </plugin>

I do have one integration test in the following package:

com.bignibou.tests.integration.repository.advertisement

However, mvn-failsafe-plugin does not pick it up.

What is wrong with my include syntax?


Solution

  • Changing to this:

    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.16</version>
                    <configuration>
                        <skip>false</skip>
                        <includes>
                            <include>**/integration/**</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>failsafe-itest</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                            <configuration>
                                <skip>false</skip>
                                <includes>
                                    <include>**/integration/**</include>
                                </includes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    

    Sorted the issue.

    However, I have to run the plugin itself with mvn failsafe:integration-test in order to run integration-test only and shortcircuit the unit-tests!