Conditionally disable dependencyLock.disableGlobalLock#285
Merged
OdysseusLives merged 5 commits intonebula-plugins:mainfrom Nov 20, 2025
Merged
Conditionally disable dependencyLock.disableGlobalLock#285OdysseusLives merged 5 commits intonebula-plugins:mainfrom
OdysseusLives merged 5 commits intonebula-plugins:mainfrom
Conversation
added 4 commits
November 20, 2025 11:30
OdysseusLives
approved these changes
Nov 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conditionally Disable Global Lock Feature
Overview
This document describes the
dependencyLock.disableGlobalLockproperty that can be used to disable global lock functionality and avoid concurrency issues in parallel builds.Problem
The global lock feature (
generateGlobalLock,updateGlobalLock,saveGlobalLock) can causeConcurrentModificationExceptionwhen:This happens even when global lock tasks are not scheduled to run.
Solution
A new Gradle property
dependencyLock.disableGlobalLockhas been introduced to completely disable the global lock feature.Usage
Option 1: Via gradle.properties
Add to your project's
gradle.propertiesfile:dependencyLock.disableGlobalLock=trueOption 2: Via Command Line
Pass the property when running Gradle commands:
Option 3: Via ~/.gradle/gradle.properties
Add to your global Gradle properties file for all projects:
dependencyLock.disableGlobalLock=trueWhat Gets Disabled
When
dependencyLock.disableGlobalLock=trueis set:Tasks NOT created:
generateGlobalLock- Generate global lock fileupdateGlobalLock- Update existing global lock filesaveGlobalLock- Save global lock to project directorydeleteGlobalLock- Delete global lock fileValidations skipped:
saveLocktasks no longer check for global lock file existenceWhat still works:
generateLock- Generate individual project lock filesupdateLock- Update individual project lock filessaveLock- Save individual project lock filesdeleteLock- Delete individual project lock filesImplementation Details
Code Changes
1. New Property Constant (DependencyLockPlugin.kt)
2. Helper Method (DependencyLockTaskConfigurer.groovy)
3. Conditional Task Creation
4. Early Return in Validation
Benefits
ConcurrentModificationExceptionin parallel buildsWhen to Use
Enable this property if:
ConcurrentModificationExceptionerrorsBackward Compatibility
Example Scenarios
Multi-project Build Without Global Locks
Debugging Concurrency Issues
CI/CD Pipeline