@ -32,6 +32,9 @@ To make sure that the lifecycle of your Spring Boot application is properly mana
Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect.
Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect.
NOTE: By default, the application is started in a separate process and JMX is used to communicate with the application.
If you need to configure the JMX port, see <<integration-tests-example-jmx-port,the dedicated example>>.
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests-example-skip,the dedicated example>>.
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests-example-skip,the dedicated example>>.
include::goals/start.adoc[leveloffset=+1]
include::goals/start.adoc[leveloffset=+1]
@ -119,6 +122,54 @@ You can now retrieve the `test.server.port` system property in any of your integ
[[integration-tests-example-jmx-port]]
==== Customize JMX port
The `jmxPort` property allows to customize the port the plugin uses to communicate with the Spring Boot application.
This example shows how you can customize the port in case `9001` is already used:
[source,xml,indent=0,subs="verbatim,attributes"]
----
<project>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>{gradle-project-version}</version>
<configuration>
<jmxPort>9009</jmxPort>
</configuration>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<skip>${skip.it}</skip>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<skip>${skip.it}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
----
TIP: If you need to configure the JMX port, make sure to do so in the global configuration as shown above so that it is shared by both goals.
[[integration-tests-example-skip]]
[[integration-tests-example-skip]]
==== Skip Integration Tests
==== Skip Integration Tests
The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether.
The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether.