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:
<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>