Skip to content

Commit 5a08632

Browse files
committed
Polish "Document Failsafe configuration when not using starter parent"
See gh-25621
1 parent 0d79fd3 commit 5a08632

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ If you need to configure the JMX port, see <<integration-tests-example-jmx-port,
3636

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

39+
40+
41+
[[integration-tests-no-starter-parent]]
42+
=== Using Failsafe Without Spring Boot's Parent POM
43+
Spring Boot's Parent POM, `spring-boot-starter-parent`, configures Failsafe's `<classesDirectory>` to be `${project.build.outputDirectory}`.
44+
Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes.
45+
If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example:
46+
47+
[source,xml,indent=0,subs="verbatim,attributes"]
48+
----
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-failsafe-plugin</artifactId>
52+
<configuration>
53+
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
54+
</configuration>
55+
</plugin>
56+
----
57+
3958
include::goals/start.adoc[leveloffset=+1]
4059

4160
include::goals/stop.adoc[leveloffset=+1]

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ For instance, to use a different version of the SLF4J library and the Spring Dat
105105
</dependencyManagement>
106106
----
107107

108-
[[failsafe-plugin]]
109-
=== Using Maven Failsafe Plugin without the Spring Boot Parent POM
110-
When using the Failsafe plugin, the Spring Boot Parent POM by default configures the `<classesDirectory>` to be `${project.build.outputDirectory}`.
111-
This configures Failsafe to use the compiled classes rather than the repackaged jar as such:
112-
113-
[source,xml,indent=0]
114-
----
115-
<plugin>
116-
<groupId>org.apache.maven.plugins</groupId>
117-
<artifactId>maven-failsafe-plugin</artifactId>
118-
<configuration>
119-
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
120-
</configuration>
121-
</plugin>
122-
----
123108

124109

125110
[[using-overriding-command-line]]

0 commit comments

Comments
 (0)