Commit 11d85155 authored by Stephane Nicoll's avatar Stephane Nicoll

Add failsafe default configuration

Provides better default for integration tests. Also expand the
documentation of the maven plugin in that area.

Closes gh-4223
parent e293008c
...@@ -2046,7 +2046,7 @@ ...@@ -2046,7 +2046,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId> <artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version> <version>2.19.1</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
......
...@@ -61,6 +61,18 @@ ...@@ -61,6 +61,18 @@
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<!-- Apply more sensible defaults for user projects --> <!-- Apply more sensible defaults for user projects -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
......
...@@ -231,6 +231,54 @@ spring.devtools.remote.restart.enabled=false ...@@ -231,6 +231,54 @@ spring.devtools.remote.restart.enabled=false
Such setup can now use the {{{http://maven.apache.org/surefire/maven-failsafe-plugin/}failsafe-plugin}} to Such setup can now use the {{{http://maven.apache.org/surefire/maven-failsafe-plugin/}failsafe-plugin}} to
run your integration tests as you would expect. run your integration tests as you would expect.
You could also configure a more advanced setup to skip the integration tests when a specific property has
been set:
---
<properties>
<it.skip>false</it.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>${it.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<skip>${it.skip}</skip>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<skip>${it.skip}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
---
If you run <<<mvn verify -Dit.skip=true>>> your integration tests will be skipped altogether.
For more detailed examples of how to configure this goal see: For more detailed examples of how to configure this goal see:
* {{{./examples/it-random-port.html}Random port for integration tests}} * {{{./examples/it-random-port.html}Random port for integration tests}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment