Skip to content

Commit f5b5361

Browse files
xenoterracidewilkinsona
authored andcommitted
Document use of module replacements to swap dependencies
See gh-25944 Signed-off-by: Caleb Cushing <xenoterracide@gmail.com>
1 parent 75db02d commit f5b5361

File tree

1 file changed

+7
-12
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc

1 file changed

+7
-12
lines changed

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

+7-12
Original file line numberDiff line numberDiff line change
@@ -1460,21 +1460,16 @@ The following example shows how to set up the starters in Maven:
14601460
</dependency>
14611461
----
14621462

1463-
And the following example shows one way to set up the starters in Gradle:
1463+
And the following example shows one way to set up the starters in https://docs.gradle.org/current/userguide/resolution_rules.html#sec:module_replacement[Gradle]:
14641464

14651465
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
14661466
----
1467-
dependencies {
1468-
compile 'org.springframework.boot:spring-boot-starter-web'
1469-
}
1470-
1471-
configurations.all {
1472-
resolutionStrategy.dependencySubstitution.all { dependency ->
1473-
if (dependency.requested instanceof ModuleComponentSelector && dependency.requested.module == 'spring-boot-starter-logging') {
1474-
dependency.useTarget("org.springframework.boot:spring-boot-starter-log4j2:$dependency.requested.version", 'Use Log4j2 instead of Logback')
1475-
}
1476-
}
1477-
}
1467+
dependencies {
1468+
modules {
1469+
module("org.springframework.boot:spring-boot-starter-logging") {
1470+
replacedBy("org.springframework.boot:spring-boot-starter-log4j2")
1471+
}
1472+
}
14781473
}
14791474
----
14801475

0 commit comments

Comments
 (0)