Skip to content

buildInfo does not work with Gradle 8.7 or later when the configuration cache is enabled #40911

Closed
@jkuipers

Description

@jkuipers

After upgrading to Boot 3.3.0 I noticed that the Gradle configuration cache throws an error. This is related to the configuration of the Boot plugin's buildInfo. With this config:

plugins.withId('org.springframework.boot') {
  springBoot {
    buildInfo {
      properties {
        excludes = ['time']
      }
    }
  }
}

I'm getting this error when running Gradle with the config cache enabled:

Configuration cache state could not be cached: field `writeLock` of `org.springframework.util.function.SingletonSupplier` bean found in field `creationTime` of `org.springframework.boot.gradle.tasks.buildinfo.BuildInfoProperties` bean found in field `properties` of task `:bootBuildInfo` of type `org.springframework.boot.gradle.tasks.buildinfo.BuildInfo`: error writing value of type 'java.util.concurrent.locks.ReentrantLock'
> Unable to make field private final java.util.concurrent.locks.ReentrantLock$Sync java.util.concurrent.locks.ReentrantLock.sync accessible: module java.base does not "opens java.util.concurrent.locks" to unnamed module @d0d7a47f

Here's a project that reproduces the problem: just run a regular build to see the error.
gradle-config-cache.zip

This problem did not occur with Boot 3.2.x versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions