Skip to content

Add property 'spring-boot.version' to dependency managements #9823

@stepio

Description

@stepio

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:

  1. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions