jenkinsci / plugin-pom

Parent POM for Jenkins Plugins
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
MIT License
68 stars 77 forks source link

Upgrade `palantir-java-format` to Java 21 compatible release #816

Closed basil closed 1 year ago

basil commented 1 year ago

When running palantir-java-format with Java 21, the current release fails with java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()'. This error was fixed in https://github.com/palantir/palantir-java-format/pull/909 and released in 2.35.0; however, pending https://github.com/diffplug/spotless/issues/1774 that version is not used by Spotless. This PR adopts the workaround suggested in https://github.com/diffplug/spotless/issues/1774#issuecomment-1661007774 by pinning the version until such a time that Spotless delivers version 2.35.0 by default.

Testing done

Ran mvn clean verify in text-finder before these changes on Java 11, 17, and 21. 11 and 17 passed; 21 failed with the error reported above. After these changes, passed on 11, 17, and 21.

basil commented 1 year ago

spotless.check.skip has to be set to false for it to fail