Repository navigation
Format Java with open-java-format, which also runs on JDK 25 and later - #468
Merged
Merged
Conversation
palantir-java-format fails on JDK 27 (NoSuchFieldError on JCCompilationUnit.endPositions) and no fixed release exists; open-java-format keeps its packages and output, so Spotless loads it through groupArtifact. It needs JDK 21, so the java17 profile keeps palantir-java-format on JDK 17 to 20; both format the same way.
slachiewicz
force-pushed
the
agent/open-java-format
branch
from
November 22, 2026 22:32
e9d2957 to
5d9fe8c
Compare
slachiewicz
marked this pull request as ready for review
November 22, 2026 22:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spotless now formats Java with open-java-format 21.0.2 through the new
groupArtifactoption of spotless-maven-plugin 3.12.0. It is the palantir-java-format code under the same packages and with the same output, and it runs on JDK 25 to 27, where palantir-java-format fails withNoSuchFieldErrorand no fixed release exists yet.open-java-format is compiled for Java 21, so on JDK 17 to 20 the new
java17profile switches back to palantir-java-format (version.palantir-java-format, 2.80.0); Spotless keeps running on JDK 17 and later. The formatter comes from two properties,spotless.java-format.groupArtifactandspotless.java-format.version, which a project can override.Verified: plexus-utils on the 29-SNAPSHOT parent,
CI=true mvn process-sourceson JDK 17, 21 and 27 → check passes on clean sources and fails on a misformatted file; that file formats byte-identically on JDK 17 and 21; plexus-utils and plexus-compiler reformatted with open-java-format 21.0.2 → 0 files changed.