diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc index ea122ad16e..d7ebab2998 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc @@ -1460,21 +1460,16 @@ The following example shows how to set up the starters in Maven: ---- -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"] ---- - dependencies { - compile 'org.springframework.boot:spring-boot-starter-web' - } - - 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') - } - } - } +dependencies { + modules { + module("org.springframework.boot:spring-boot-starter-logging") { + replacedBy("org.springframework.boot:spring-boot-starter-log4j2") + } + } } ----