deps/locked-install/java
Installs use the lockfile strictly
Implements deps/locked-install for java.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | java |
| Scope | each |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
Gradle checks resolved versions against gradle.lockfile (and artifacts against verification metadata) on every build; this holds unless a recipe or CI step outside an update target passes --write-locks, --update-locks or --write-verification-metadata, which is what is checked.
Why
An install that quietly re-resolves builds and tests something other than what the lockfile in git says, and the drift shows up only in production.
Applies when
file("build.gradle") || file("build.gradle.kts")Check
!(taskrunner.recipes.filter(t, !t.matches(r'(?i)update|upgrade|lock|bump|renovate')).map(t, taskrunner.recipes[t]).flatten()
+ workflows().map(w, steps(w).map(s, s.run.split("\n")).flatten()).flatten())
.filter(l, !l.matches(params.noise)).exists(l, l.matches(r'--(write|update)-locks\b|--write-verification-metadata\b'))Parameters
noise:^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b)
Fix
Move lock updates to an update-locks target that is not part of CI.
Agent instruction: Switch the CI and task-runner installs to the package manager’s locked mode; if that fails, regenerate the lockfile in a separate commit rather than relaxing the install.
See: https://fleetlint.org/baseline/#dependencies, https://fleetlint.org/stacks/#java
Generated by fleetlint docs from catalog v0.3.1.