Skip to content

Spotless 7.0 beta 3 and beta4 break configuration cache in GoogleJavaFormatStep #2318

Closed

Description

@ZacSweers

If you are submitting a bug, please include the following:

  • summary of problem

Spotless 7.0 beta 3 and beta4 break configuration cache in GoogleJavaFormatStep.

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.

Activity

  1. davidburstrom commented on Nov 7, 2024

    @davidburstrom
    Contributor

    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'

  2. ZacSweers commented on Nov 7, 2024

    @ZacSweers
    ContributorAuthor

    Looks like it

  3. marcphilipp commented on Nov 15, 2024

    @marcphilipp

    I'm also seeing the error from #2318 (comment) since updating to Gradle 8.11: https://ge.junit.org/s/yychlvofhspe4/failure#1

  4. bddckr commented on Nov 18, 2024

    @bddckr

    I'm seeing the same with beta 4 and Gradle 8.11.

    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.

  5. nedtwigg commented on Jan 7, 2025

    @nedtwigg
    Member

    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.

  6. bddckr commented on Jan 7, 2025

    @bddckr

    I no longer reproduce this issue on Spotless Gradle plugin version 7.0.0 and Gradle 8.12. Thanks a lot for your work!

  7. ZacSweers commented on May 15, 2025

    @ZacSweers
    ContributorAuthor

    We still see it with 7.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions