it's weird because I have this in my dependencies, but of course I don't see that module
| +--- ch.qos.logback:logback-core:1.2.11 (c)
but I'm filtering logging in my dependencies
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2")
}
}
+--- org.springframework.boot:spring-boot-starter-parent:2.+ -> 2.7.4
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (c)
| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21 -> 1.7.10 (c)
| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 -> 1.7.10 (c)
| +--- org.springframework.security:spring-security-oauth2-client:5.7.3 (c)
| +--- jakarta.validation:jakarta.validation-api:2.0.2 (c)
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21 -> 1.7.10 (c)
| +--- org.springframework.security:spring-security-core:5.7.3 (c)
| +--- org.springframework.security:spring-security-oauth2-core:5.7.3 (c)
| +--- org.springframework.security:spring-security-web:5.7.3 (c)
| +--- org.springframework:spring-core:5.3.23 (c)
| +--- org.springframework.boot:spring-boot-autoconfigure:2.7.4 (c)
| +--- org.springframework.boot:spring-boot-starter-aop:2.7.4 (c)
| +--- net.minidev:json-smart:2.4.8 (c)
| +--- org.springframework.security:spring-security-crypto:5.7.3 (c)
| +--- org.springframework:spring-aop:5.3.23 (c)
| +--- org.springframework:spring-beans:5.3.23 (c)
| +--- org.springframework:spring-context:5.3.23 (c)
| +--- org.springframework:spring-expression:5.3.23 (c)
| +--- org.springframework:spring-web:5.3.23 (c)
| +--- org.springframework:spring-jcl:5.3.23 (c)
| +--- org.slf4j:slf4j-api:1.7.36 (c)
| +--- org.springframework.boot:spring-boot:2.7.4 (c)
| +--- org.springframework.boot:spring-boot-starter:2.7.4 (c)
| +--- org.aspectj:aspectjweaver:1.9.7 (c)
| +--- org.springframework.boot:spring-boot-starter-logging:2.7.4 (c)
| +--- jakarta.annotation:jakarta.annotation-api:1.3.5 (c)
| +--- org.yaml:snakeyaml:1.30 (c)
| +--- ch.qos.logback:logback-classic:1.2.11 (c)
| +--- org.apache.logging.log4j:log4j-to-slf4j:2.17.2 (c)
| +--- org.slf4j:jul-to-slf4j:1.7.36 (c)
| +--- ch.qos.logback:logback-core:1.2.11 (c)
| \--- org.apache.logging.log4j:log4j-api:2.17.2 (c)
in case you need it here's the full dependency list
------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.4 (Eclipse Adoptium 17.0.4+8)
OS: Mac OS X 12.6 x86_64
Comment From: wilkinsona
A replacement alone isn't sufficient, you need to declare a dependency on Log4j2 as well. This is described in the documentation.
This isn't directly related to you r problem but spring-boot-starter-parent is intended for use as the parent of a module built with Maven. When using Gradle, you should use spring-boot-dependencies.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: xenoterracide
oh... I see what's going on. It's ending up there at the compiletime classpath because something is including it there, I have the log4j 2 starter included as runtime only because I don't having everything it adds on the compiletime classpath. honestly I kind of hate that starters always want me to be able to import all the things. I've made a giant libs.versions.toml just to try to avoid this stuff, and it still fails at a lot of it. This also explains why I really only noticed the problem in intellij.