Gradle build fails when dependency resolution would update lockfile
0 reputation · 08 Dec 2021, 00:51 UTC
Goal
Our team wants a repeatable development environment using Gradle dependency locking so resolved dependency versions stay consistent across local machines and CI.
Gradle writes lockfiles recording resolved versions, repositories, and metadata. During a normal build, Gradle does not automatically regenerate these lockfiles; if resolution would change a recorded entry, the build fails unless the --write-locks flag is used. We need to know whether automatic lockfile refresh is supported in any Gradle version, or whether manual regeneration remains the only supported path.
Which Gradle versions support automatic lockfile regeneration during a standard build? Is --write-locks the only supported way to update lockfiles, or can this behavior be enabled through a configuration property?