-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
Dear Spring Boot team,
Thank you very much for this project - I use it much and it's really great.
I'd like to propose a minor improvement.
Use case:
- I'd like to use this set of modules:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Although logback is nice, I found that log4j2 is a little bit better in terms of configurations' flexibility.
To prevent error with "multiple SLF4J bindings" I need to exclude "spring-boot-starter-logging" from both "spring-boot-starter-actuator" and "spring-boot-starter-thymeleaf".
The cleanest way to achieve this (correct me if I'm wrong) is to add next block to my dependency management block ("version" tag is required by maven and cannot be omitted):
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
So if I had "spring-boot.version" variable defined in "spring-boot-dependencies" module, that would be a little bit cleaner in terms of future support. Otherwise, I have to maintain this variable myself and update both this value and parent's version (I extend "spring-boot-starter-parent") - not a big issue, obviously, but I'd prefer to avoid this.
What do you think? Does this make sense?