Skip to content

Commit 2ef7d13

Browse files
committed
Merge branch '2.3.x' into 2.4.x
Closes gh-26525
2 parents 49d362f + 9022784 commit 2ef7d13

File tree

1 file changed

+16
-21
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc

1 file changed

+16
-21
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc

+16-21
Original file line numberDiff line numberDiff line change
@@ -453,22 +453,19 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
453453

454454
NOTE: The version of the Servlet API has been overridden as, unlike Tomcat 9 and Undertow 2.0, Jetty 9.4 does not support Servlet 4.0.
455455

456-
The following Gradle example shows how to use Undertow in place of Reactor Netty for Spring WebFlux:
456+
The following Gradle example configures the necessary dependencies and a {gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement] to use Undertow in place of Reactor Netty for Spring WebFlux:
457457

458458
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
459459
----
460-
configurations.all {
461-
resolutionStrategy.dependencySubstitution.all { dependency ->
462-
if (dependency.requested instanceof ModuleComponentSelector && dependency.requested.module == 'spring-boot-starter-reactor-netty') {
463-
dependency.useTarget("org.springframework.boot:spring-boot-starter-undertow:$dependency.requested.version", 'Use Undertow instead of Reactor Netty')
464-
}
460+
dependencies {
461+
implementation "org.springframework.boot:spring-boot-starter-undertow"
462+
implementation "org.springframework.boot:spring-boot-starter-webflux"
463+
modules {
464+
module("org.springframework.boot:spring-boot-starter-reactor-netty") {
465+
replacedBy("org.springframework.boot:spring-boot-starter-undertow", "Use Undertow instead of Reactor Netty")
465466
}
466467
}
467-
468-
dependencies {
469-
compile 'org.springframework.boot:spring-boot-starter-webflux'
470-
// ...
471-
}
468+
}
472469
----
473470

474471
NOTE: `spring-boot-starter-reactor-netty` is required to use the `WebClient` class, so you may need to keep a dependency on Netty even when you need to include a different HTTP server.
@@ -1497,19 +1494,17 @@ The following example shows how to set up the starters in Maven:
14971494
</dependency>
14981495
----
14991496

1500-
And the following example shows one way to set up the starters in Gradle:
1497+
Gradle provides a few different ways to set up the starters.
1498+
One way is to use a {gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement].
1499+
To do so, declare a dependency on the Log4j 2 starter and tell Gradle that any occurrences of the default logging starter should be replaced by the Log4j 2 starter, as shown in the following example:
15011500

15021501
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
15031502
----
1504-
dependencies {
1505-
compile 'org.springframework.boot:spring-boot-starter-web'
1506-
}
1507-
1508-
configurations.all {
1509-
resolutionStrategy.dependencySubstitution.all { dependency ->
1510-
if (dependency.requested instanceof ModuleComponentSelector && dependency.requested.module == 'spring-boot-starter-logging') {
1511-
dependency.useTarget("org.springframework.boot:spring-boot-starter-log4j2:$dependency.requested.version", 'Use Log4j2 instead of Logback')
1512-
}
1503+
dependencies {
1504+
implementation "org.springframework.boot:spring-boot-starter-log4j2"
1505+
modules {
1506+
module("org.springframework.boot:spring-boot-starter-logging") {
1507+
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
15131508
}
15141509
}
15151510
}

0 commit comments

Comments
 (0)