Reputation: 6114
Sorry about this very basic questions about maven-failsafe-plugin
but I am not very much familiar with maven.
maven-failsafe-plugin
to run integration tests?mvn verify
execute integration tests just like mvn test
executes unit tests? Upvotes: 2
Views: 285
Reputation: 2049
Completely Agree with dunni's answer. Adding few more points.
This has been correctly answered by dunni.
Addiing additional info, To use the Failsafe Plugin, you need to add the following configuration to your project pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin-version}</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Upvotes: 1
Reputation: 44555
mvn test
executes the unit tests, because Maven has a default binding from test
to surefire:test
, meaning, if you execute the phase test
, Maven will call the surefire plugin with the goal test
. However, there is no default binding for the integration test or verify phase, so you have to provide it yourself by specifying the failsafe plugin.
Upvotes: 4