The Apollo GraphQL client depends on OkHttp 3 which depends on Kotlin. In a Java-based application, this results in the following warning being logged:

2021-05-20 19:06:02.663  WARN 41818 --- [kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath

Adding com.fasterxml.jackson.module:jackson-module-kotlin isn't the right thing to do as Jackson isn't handling any Kotlin types. The warning is the only logging done by Jackson2ObjectMapperBuilder so I could raise its log level to error without losing anything, but you have to know that's the right thing to do. I suspect many will unnecessarily add the dependency instead. In short, the warning feels a bit over-zealous to me.

I wonder if it would be possible to detect an actual problem caused by the lack of jackson-module-kotlin and log something at that point instead? If that's not possible, perhaps the log message could be lowered to info level and softened a bit to indicate that jackson-module-kotlin is only needed if Jackson will be dealing with Kotlin classes?

Comment From: sdeleuze

I think would just remove that warning and refine the documentation to make that point more visible. It was introduced in the early days of Spring's Kotlin support, it is coming from how Jackson is architectured and nowadays most developers know how it works, https://start.spring.io/ and https://spring.io/guides/tutorials/spring-boot-kotlin/ being there for beginners.

Comment From: julius-d

In another project we also get the warn now after updating to spring-boot 2.5. The project does not have Apollo GraphQL as a dependency. The reason why kotlin-stdlib-jdk8 is in the list of the projects dependencies is spring-security-config version 5.5.0. Spring-security-config 5.5.0 has kotlin-stdlib-jdk8 as a compile dependency!

Comment From: snicoll

@julius-d can you please report that issue against Spring Security?. The dependency change that you've described must be addressed there and there's nothing we can do about it here.

Comment From: jgrandja

@julius-d Looks like spring-security#9811 is the same issue?

/cc @snicoll