> > > It has a caveat (we can't run formatter on 21 and 8, and we need to choose >> one). > > > Would it format differently? I would go for 21 since that's the path > forward, but I'm also fine with JB's suggestion 👍 > >> >> Yeah it would format differently, because the underlying *google-java-format* picks a different formatting depending on the JDK version and that's why we had to pin the *google-java-format* version to the one that still supports JDK8.
I think it's ok to disable the formatter when running with JDK 21 for people that want to use that JDK but we need to make sure that CI checks still run JDK < 21 in order to make sure code is properly formatted. The one risk I see is that it will be difficult to understand why running the build with JDK 21 passes locally but fails on CI (where an older JDK is used). Maybe it's sufficient to mention in the docs that *./gradlew spotlessApply* needs to be executed locally with an older JDK. Eduard