-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update default versions for palantir-java-format #1774
Comments
This was fixed upstream in palantir/palantir-java-format#886 and released in 2.33.0 but spotless/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java Line 33 in 8b1713d
|
You can set the version manually as a workaround. I think it's like this: |
Ostensibly fixed, but both 2.33.0 and 2.34.0 do not work for me: palantir/palantir-java-format#885 (comment) |
The first fix was incomplete. palantir/palantir-java-format#909 solves the problem and I have verified the fix locally. |
This was released in 2.35.0 and I have verified the fix locally. Suggest the following patch: diff --git a/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java b/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
index f769ad09..24bd6434 100644
--- a/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
+++ b/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
@@ -30,7 +30,7 @@ public class PalantirJavaFormatStep {
private static final String DEFAULT_STYLE = "PALANTIR";
private static final String NAME = "palantir-java-format";
private static final String MAVEN_COORDINATE = "com.palantir.javaformat:palantir-java-format:";
- private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0");
+ private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0").add(21, "2.35.0");
/** Creates a step which formats everything - code, import order, and unused imports. */
public static FormatterStep create(Provisioner provisioner) { |
Published in |
The above fix seems like it's not enough for Java 21 support in my codebase. I opened #1944 |
Summary of problem
Spotless Maven Plugin (Palantir Java Format) does not work on Java 21. It works fine on Java 17.
Maven version
Apache Maven 3.9.2
Spotless version
2.38.0
Operating system and version
OS name: "linux", version: "5.15.0-78-generic", arch: "amd64", family: "unix"
OpenJDK Runtime Environment (build 21-ea+32-2482) 2023-09-19
Configuration
https://github.com/jenkinsci/plugin-pom/blob/master/pom.xml
Can be reproduced by cloning e.g. https://github.com/jenkinsci/text-finder-plugin and running
mvn clean verify -DskipTests
.Stack trace
The text was updated successfully, but these errors were encountered: