You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spotless 7.0 beta 3 and beta4 break configuration cache in GoogleJavaFormatStep #2318
Caused by: org.gradle.api.GradleException: Add a step with [com.google.googlejavaformat:google-java-format:1.24.0] into the `spotlessPredeclare` block in the root project.
at com.diffplug.gradle.spotless.GradleProvisioner$DedupingProvisioner.lambda$new$0(GradleProvisioner.java:99)
at com.diffplug.spotless.JarState.provisionWithTransitives(JarState.java:109)
at com.diffplug.spotless.JarState.from(JarState.java:98)
at com.diffplug.spotless.JarState.from(JarState.java:93)
at com.diffplug.spotless.java.GoogleJavaFormatStep.lambda$createInternally$1(GoogleJavaFormatStep.java:106)
at com.diffplug.spotless.JarState$Promised.get(JarState.java:53)
at com.diffplug.spotless.java.GoogleJavaFormatStep.equalityState(GoogleJavaFormatStep.java:152)
at com.diffplug.spotless.FormatterStepSerializationRoundtrip.stateSupplier(FormatterStepSerializationRoundtrip.java:57)
at com.diffplug.spotless.ThrowingEx.get(ThrowingEx.java:67)
at com.diffplug.spotless.FormatterStepSerializationRoundtrip$HackClone.writeObject(FormatterStepSerializationRoundtrip.java:113)
If you're just submitting a feature request or question, no need for the above.
Is this the same kind of issue as the following stack trace header indicates?
org.gradle.internal.cc.base.exceptions.ConfigurationCacheError: Configuration cache state could not be cached: field `backingList` of `com.diffplug.spotless.ConfigurationCacheHackList` bean found in field `stepsInternalEquality` of task `:spotlessKotlin` of type `com.diffplug.gradle.spotless.SpotlessTaskImpl`: error writing value of type 'java.util.ArrayList'
After commenting out all googleJavaFormat usages for a test, I then get the issue for ktfmt. Once commenting that out, it's gson. So I think it's fair to say this is a general issue, not one specific to the Google Java Format step.
The inner-most cause is what the original post mentions. The second-to-last cause is the config cache issue mentioned above.
This might be resolved in 7.0.0. If it's not, can you tell me what command to run to replicate the error? I cloned the repo but spotlessApply is working for me even with 7.0.0.BETA4.
Activity
davidburstrom commentedon Nov 7, 2024
Is this the same kind of issue as the following stack trace header indicates?
org.gradle.internal.cc.base.exceptions.ConfigurationCacheError: Configuration cache state could not be cached: field `backingList` of `com.diffplug.spotless.ConfigurationCacheHackList` bean found in field `stepsInternalEquality` of task `:spotlessKotlin` of type `com.diffplug.gradle.spotless.SpotlessTaskImpl`: error writing value of type 'java.util.ArrayList'ZacSweers commentedon Nov 7, 2024
Looks like it
marcphilipp commentedon Nov 15, 2024
I'm also seeing the error from #2318 (comment) since updating to Gradle 8.11: https://ge.junit.org/s/yychlvofhspe4/failure#1
Disable configuration cache on CI due to Spotless issue
bddckr commentedon Nov 18, 2024
I'm seeing the same with beta 4 and Gradle 8.11.
After commenting out all
googleJavaFormatusages for a test, I then get the issue forktfmt. Once commenting that out, it'sgson. So I think it's fair to say this is a general issue, not one specific to the Google Java Format step.The inner-most cause is what the original post mentions. The second-to-last cause is the config cache issue mentioned above.
nedtwigg commentedon Jan 7, 2025
This might be resolved in
7.0.0. If it's not, can you tell me what command to run to replicate the error? I cloned the repo butspotlessApplyis working for me even with7.0.0.BETA4.bddckr commentedon Jan 7, 2025
I no longer reproduce this issue on Spotless Gradle plugin version
7.0.0and Gradle8.12. Thanks a lot for your work!ZacSweers commentedon May 15, 2025
We still see it with 7.0.3