Commit f5b53616 authored by Caleb Cushing's avatar Caleb Cushing Committed by Andy Wilkinson

Document use of module replacements to swap dependencies

See gh-25944
Signed-off-by: 's avatarCaleb Cushing <xenoterracide@gmail.com>
parent 75db02d6
...@@ -1460,21 +1460,16 @@ The following example shows how to set up the starters in Maven: ...@@ -1460,21 +1460,16 @@ The following example shows how to set up the starters in Maven:
</dependency> </dependency>
---- ----
And the following example shows one way to set up the starters in Gradle: 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]:
[source,groovy,indent=0,subs="verbatim,quotes,attributes"] [source,groovy,indent=0,subs="verbatim,quotes,attributes"]
---- ----
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' modules {
} module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2")
configurations.all { }
resolutionStrategy.dependencySubstitution.all { dependency -> }
if (dependency.requested instanceof ModuleComponentSelector && dependency.requested.module == 'spring-boot-starter-logging') {
dependency.useTarget("org.springframework.boot:spring-boot-starter-log4j2:$dependency.requested.version", 'Use Log4j2 instead of Logback')
}
}
}
} }
---- ----
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment