fleetlint Policy for a fleet of repositories
v0.10
Getting started

deps/unused-check/java

Unused dependencies are detected

Implements deps/unused-check for java.

Severityinfo
Tiers1
Stacksjava
Scopeeach
Kindoutcome
Sourcelibrary v0.7.0
Selected byfleetlint-recommended@v0.7.0

Requirement

maven-dependency-plugin’s analyze runs with failOnWarning (bound in pom.xml or invoked as dependency:analyze), or the Gradle dependency-analysis plugin’s buildHealth runs (in a recipe, a CI step, a task dependency, or with severity("fail")).

Why

Every declared dependency is attack surface and update churn; one nothing uses is pure cost.

Parameters

  • runners: [../Makefile ../justfile ../Justfile ../Taskfile.yml ../Taskfile.yaml ../../Makefile ../../justfile ../../Justfile ../../Taskfile.yml ../../Taskfile.yaml ../../../Makefile ../../../justfile ../../../Justfile ../../../Taskfile.yml ../../../Taskfile.yaml]
  • skip: ^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b|(sudo\s+)?(go (install|get)|cargo b?install|pipx? install|pip3 install|python3? -m pip install|uv (tool |pip )?(install|add)|(npm|pnpm|yarn|bun) (i|install|add|global add)|gem install|bundle add|brew install|dotnet tool (install|update)|composer (global )?require|apt(-get)? install|curl|wget)\b[^;&]*$)

Fix

Gradle: apply com.autonomousapps.dependency-analysis and run buildHealth in audit; Maven: bind dependency:analyze-only with failOnWarning.

Agent instruction: Add the stack’s unused-dependency checker to the audit target; remove the dependencies it reports in a separate change after confirming nothing loads them dynamically.

A finding of this rule points at the file (["pom.xml", "build.gradle.kts", "build.gradle"].filter(f, file(f)) + ["pom.xml"])[0] yields.

Sources


Generated by fleetlint docs from catalog v0.7.0.