Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Maven & Spring boot – I need to force logback 1.5.13 but can't

My spring boot 3.4.1 project wants logback 1.5.12 from the spring-boot-starter-web dependency.

I have tried including logback as a top-level dependency and excluding from the spring boot start web (doesn’t work):

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I have tried dependency management:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>1.5.13</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

but then my dependency tree looks like this and still does not work:

[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:3.4.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:3.4.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:3.4.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:3.4.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:3.4.1:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.5.12:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.5.13:compile

How can I force this newer version?

>Solution :

You seem to have added dependency on logback-core and fixed its version to 1.5.13. The dependency tree shows logback-classic using 1.5.12.

I think you need to add another section with logback-classic and 1.5.12 version. Possibly you can get away with replacing the logback-core entry.

i.e. try

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.5.13</version>
            </dependency>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading