Skip to content

Commit

Permalink
Merge branch '2.3.x'
Browse files Browse the repository at this point in the history
Closes gh-23143
  • Loading branch information
snicoll committed Aug 31, 2020
2 parents 1fea691 + b80314b commit e0b41f8
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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>>.

include::goals/start.adoc[leveloffset=+1]
Expand Down Expand Up @@ -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]]
==== Skip Integration Tests
The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether.
Expand Down

0 comments on commit e0b41f8

Please sign in to comment.