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
Broken with OpenJDK 24 (gradle 9.x snapshots) #4018
[error] FAILURE: Build failed with an exception.
* What went wrong:
Resolution of the configuration ':brigadier:annotationProcessor' was attempted without an exclusive lock. This is unsafe and not allowed.
The project builds fine from the command line (with JAVA_HOME set to Java 24), so I assume it is an issue with this extension, or maybe eclipse jdtls.
Worth noting that this is not specific to Java 24 nor to Gradle snapshots. The issue remains on Java 25 and 26, as well as stable Gradle 9 releases.
I managed to work around the issue by adding the following Gradle init file with Claude's help (~/.gradle/init.d/ide-import-compat.init.gradle.kts):
import org.gradle.api.internal.project.ProjectInternal
// Gradle 9.x requires an exclusive project lock to resolve any configuration.
// When the Gradle Build Server fetches the IDE model via a BuildAction, it resolves
// all resolvable configurations (annotationProcessor, checkstyle, compileClasspath, …)
// without holding individual sub-project locks, causing:
// "Resolution of the configuration '...' was attempted without an exclusive lock."
//
// Fix: pre-resolve ALL resolvable configurations in gradle.projectsEvaluated, which fires
// after ALL afterEvaluate callbacks complete. We acquire each project's lock explicitly via
// applyToMutableState so hasMutableState() is true during resolution.
// DefaultConfiguration.resolveGraphIfRequired() then short-circuits on the cached result
// before the hasMutableState() check when the GBS model builder runs.
if (gradle.startParameter.taskNames.isEmpty()) {
gradle.projectsEvaluated {
rootProject.allprojects {
val projectOwner = (this as ProjectInternal).owner
configurations
.filter { it.isCanBeResolved }
.forEach { config ->
projectOwner.applyToMutableState { _ ->
try {
config.resolve()
} catch (_: Exception) {
// Ignore — best-effort pre-resolution; IDE import takes priority.
}
}
}
}
}
}
Activity
einarjohnson commentedon Sep 25, 2025
did you ever figure this one out? having the same issue
KAFKA-19174 Gradle version upgrade 8 -->> 9 (#19513)
KAFKA-19174 Gradle version upgrade 8 -->> 9 (apache#19513)
KAFKA-19174 Gradle version upgrade 8 -->> 9 (apache#19513)
PyvesB commentedon May 27, 2026
Worth noting that this is not specific to Java 24 nor to Gradle snapshots. The issue remains on Java 25 and 26, as well as stable Gradle 9 releases.
I managed to work around the issue by adding the following Gradle init file with Claude's help (
~/.gradle/init.d/ide-import-compat.init.gradle.kts):