From cc234be6c40ac6ff97a4ff5374e74793255c9a70 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 8 Jun 2025 06:29:31 -0600 Subject: [PATCH] Declare formatter version to avoid spotless choosing a version https://github.com/diffplug/spotless/issues/2503#issuecomment-2953146277 indicates that spotless chooses a formatter version based on the JDK running the formatting process. The spotless maintainer recommends that we declare a formatter version explicitly so that the formatter won't change based on the JDK version. Testing done: MAVEN_OPTS=-Djansi.force=true mvn -B -Dstyle.color=always -ntp clean verify In the winstone repository (where we saw the issue): Reverted the change that made the formatting independent of Java version in b95111923002d82598d4d85f67f40fa6170dda5e and then added explicit spotless version definition to the pom file so that I could confirm that changing Java versions does not change the formatting. https://github.com/MarkEWaite/winstone/commit/78ea965783b5be03f143cb12ba30897581273dd1 has the details . ~/bin/use_java17 mvn spotless:apply git status . ~/bin/use_java21 mvn spotless:apply git status --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7660f8aef6..b5602f0af4 100644 --- a/pom.xml +++ b/pom.xml @@ -688,7 +688,11 @@ true - + + + + 2.67.0 +