-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Improve documentation about swapping one technical starter for another #20408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The documentation says that I think we could improve things by adding a paragraph beneath the table of technical starters that links to the how-to sections that describe how to swap one for another.
I think this is a good idea, thank you. We could do the same in the section on using another web server as well. |
Exactly: So yes, IMHO at least a hint/link to the how-to guide from those first documentation pages would be really useful. |
@wilkinsona if you're interested in following the "dependency substitution" idea, please note that, as explained at gradle/gradle#12459 (comment), I just found that a fully working solution by now (Gradle 6.5) is to also include the dependency version in the target definition: configurations.all {
resolutionStrategy.dependencySubstitution.all { DependencySubstitution 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", 'we use Log4j2 instead of Logback')
}
} Otherwise although some things work, when Gradle tries to resolve the |
Uh oh!
There was an error while loading. Please reload this page.
I'm new to Spring Boot.
I created an application with https://start.spring.io/, using Gradle, Java 11, Spring Boot 2.2.5.
Reading the reference documentation here and here, I understand that to replace the Logback implementation with the Log4j2 one I should simply add the
spring-boot-starter-log4j2
starter. So, my Gradle build script looks like this:Please note that I'm not using the Spring dependency plugin, but rather the builtin BOM support from recent Gradle.
However, when I start my application, I get the following:
Searching on the Internet I could not find that the documented way to do this is put in a completely different page of the reference documentation in the how-to guides. I just discovered it by chance by looking at the "similar issues" list suggested by GitHub, while creating this issue. If at least a hint/link from the previous paragraph to the how-to guide were present, it would have saved me quite a lot of time.
I was also wondering whether a dependency substitution could be a better alternative:
Gradle documentation, in fact, pushes against the use of generic "exclusions", which are poor in semantics.
Another glitch with the documentation about logging is that in the dedicated paragraph, after talking about the file rotation logging properties a note says:
However, in a subsequent paragraph a table shows that most of the logging properties can be used only with the default Logback setup, including those regarding file rotation... So, I would not say they are so "independent" :-)
The text was updated successfully, but these errors were encountered: