5

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?

A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
Sujen
  • 1,614
  • 5
  • 19
  • 25

1 Answers1

12

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?

Slava Semushin
  • 14,904
  • 7
  • 53
  • 69
  • yea, i was missing that in my pom – Sujen Jun 17 '11 at 13:30
  • Official documentation is 404. – Svish Feb 06 '13 at 13:20
  • By the way, are these tests supposed to run by default when you do `mvn package` or something like that? Cause I seem to only be able to run them by doing `mvn integration-test` explicitly. Is it supposed to be like that? – Svish Feb 06 '13 at 13:56
  • @svish (It's better to create separate question... in next time) Phase `integration-test` goes after `package` so when you binding failsafe plugin to runs during integration tests than they obviously will not executed during packaging. See more about Maven lifecycle: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html and http://maven.apache.org/ref/3.0.4/maven-core/lifecycles.html – Slava Semushin Feb 06 '13 at 14:18
  • Yeah, I just don't want to litter SO with tiny clarifications :p thanks for the answer :) – Svish Feb 06 '13 at 14:21