Search code examples
mavenintegration-testingmaven-failsafe-plugin

Maven is not using failsafe plugin for integration tests


When I run mvn clean install, for the integration-test phase it does not use the failsafe plugin.

However if i explicilty call the plugin to run the integration test, it works (mvn failsafe:integration-test).

How can I make maven use the failsafe plugin when I run mvn clean install during the integration-test phase?


Solution

  • Quote from official documentation:

    To use the Failsafe Plugin, you need to add the following configuration
    to your pom.xml
    
    <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.11</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>
    

    Is this what you looking for?