Skip to content

Commit 518409d

Browse files
committed
Declare formatter version to avoid spotless choosing a version
diffplug/spotless#2503 (comment) 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: In this repository: mvn clean install versions:display-plugin-updates 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. MarkEWaite/winstone@78ea965 has the details . ~/bin/use_java17 mvn spotless:apply git status . ~/bin/use_java21 mvn spotless:apply git status Matching pull request in plugin pom: * jenkinsci/plugin-pom#1151
1 parent 7c9a368 commit 518409d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,11 @@
649649
<indent>
650650
<spaces>true</spaces>
651651
</indent>
652-
<palantirJavaFormat />
652+
<palantirJavaFormat>
653+
<!-- Declare version so that spotless does not choose a version based on JDK version -->
654+
<!-- https://github.com/diffplug/spotless/issues/2503#issuecomment-2953146277 -->
655+
<version>2.67.0</version>
656+
</palantirJavaFormat>
653657
<removeUnusedImports />
654658
<trimTrailingWhitespace />
655659
</java>

0 commit comments

Comments
 (0)