Repository navigation
Jvm.Support.assertFormatterSupported does not support -SNAPSHOT versions #1583
Copy link
Copy link
Closed
Labels
Description
Activity
added a commit that references this issue on Feb 23, 2023
Fixed in plugin-gradle 6.16.0 and plugin-maven 2.34.0.
@nedtwigg This seems broken with plugin-maven 2.36.0.
The stack looks similar than before 2.24.0:
Caused by: java.lang.IllegalArgumentException: Not a semantic version: 2.14-SNAPSHOT
at com.diffplug.spotless.Jvm$Support$SemanticVersionComparator.convert (Jvm.java:285)
at com.diffplug.spotless.Jvm$Support$SemanticVersionComparator.compare (Jvm.java:266)
at java.util.TreeMap.compare (TreeMap.java:1570)
at java.util.TreeMap.getCeilingEntry (TreeMap.java:395)
at java.util.TreeMap.ceilingEntry (TreeMap.java:1021)
at com.diffplug.spotless.Jvm$Support.getRequiredJvmVersion (Jvm.java:178)
at com.diffplug.spotless.Jvm$Support.buildUnsupportedFormatterMessage (Jvm.java:148)
at com.diffplug.spotless.Jvm$Support.assertFormatterSupported (Jvm.java:140)
at com.diffplug.spotless.java.CleanthatJavaStep$JavaRefactorerState.<init> (CleanthatJavaStep.java:134)
at com.diffplug.spotless.java.CleanthatJavaStep.lambda$create$1 (CleanthatJavaStep.java:97)
at com.diffplug.spotless.FormatterStepImpl.calculateState (FormatterStepImpl.java:58)
at com.diffplug.spotless.LazyForwardingEquality.state (LazyForwardingEquality.java:56)
at com.diffplug.spotless.LazyForwardingEquality.toBytes (LazyForwardingEquality.java:85)
at com.diffplug.spotless.LazyForwardingEquality.hashCode (LazyForwardingEquality.java:102)
at java.util.ArrayList.hashCodeRange (ArrayList.java:595)
at java.util.ArrayList.hashCode (ArrayList.java:582)
at com.diffplug.spotless.Formatter.hashCode (Formatter.java:276)
at java.util.HashMap.hash (HashMap.java:338)
at java.util.HashMap.put (HashMap.java:610)
at com.diffplug.spotless.maven.FormattersHolder.create (FormattersHolder.java:43)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:224)
Unclear to me how this was fixed.
Sorry, I think I saw the Add workaround for diffplug#1583 commit above and assumed that this had been fixed as part of another PR.
On my side, I supposed this was properly fixed, and removed the workaround. Sorry for the confusion.
Reacted by Ned Twigg
Fixed in plugin-gradle 6.19.0 and plugin-maven 2.37.0.
added a commit that references this issue on Aug 29, 2023
I consider a Jvm.Support like:
For local developements of the underlying plugin (cleanthat), I would like to run spotless (e.g. with
mvn spotless:apply) with a SNAPSHOT version of my plugin (e.g. through the usual<version>2.7</version>(in maven) parameter of many plugins).It fails with: