dependency-analyzer

Analyzes Maven pom.xml dependencies to identify unused, duplicate, or mis-scoped entries.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/zuldare/apuntesIA --skill dependency-analyzer-zuldare
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dependency-analyzer
Source: https://github.com/zuldare/apuntesIA/tree/main/skills/dependency-analyzer
Command: npx skills add https://github.com/zuldare/apuntesIA --skill dependency-analyzer-zuldare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Java projects accumulate stale, unused, or mis-scoped Maven dependencies over time, bloating builds and increasing maintenance risk. This Skill audits pom.xml dependencies against actual source code usage so you can safely clean up your project. ## Core Features & Use Cases - Usage Classification: Categorizes each dependency as actively used, runtime/provider, transitive duplicate, test-only, or potentially unused by scanning imports in src/main/java and src/test/java. - Runtime Dependency Awareness: Recognizes dependencies without direct imports that are still required, such as JDBC drivers, Spring Boot starters, Lombok, and logging backends. - Structured Audit Report: Produces a categorized report with scope-mismatch warnings and removal recommendations, plus verification steps using mvn compile and mvn test. - Use Case: Before a Spring Boot version upgrade, ask for a dependency audit to find unused libraries and dependencies that should be moved to test scope, reducing the upgrade surface. ## Quick Start Analyze the dependencies in my pom.xml and tell me which ones are unused or should have their scope changed.

Frequently Asked Questions about dependency-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused dependencies in a Maven project?▼

Scan pom.xml for all declared dependencies, then search src/main/java and src/test/java for matching import statements. Dependencies with no imports and no runtime requirement, such as JDBC drivers or annotation processors, are candidates for removal after verifying with mvn compile and mvn test.

How to clean up pom.xml dependencies safely?▼

Remove one candidate dependency at a time, then run mvn clean compile and mvn test to confirm nothing breaks. Never auto-remove dependencies in bulk, since some are required transitively or only at runtime.

Why does a dependency with no imports still need to stay in pom.xml?▼

Many dependencies work without direct imports: JDBC drivers load via spring.datasource configuration, Spring Boot starters pull in auto-configuration, and Lombok or hibernate-jpamodelgen act as annotation processors. Removing them breaks the build or runtime behavior.

Can I change a compile-scoped dependency to test scope in Maven?▼

Yes, if the dependency is only imported in src/test/java, change its scope to test. This keeps it out of the production artifact while remaining available for tests.

Does dependency analysis work with Spring Boot BOM-managed versions?▼

Yes, but versions managed by spring-boot-starter-parent via dependencyManagement should only be noted, not removed from the BOM. The analysis focuses on whether the dependency itself is used, not its managed version.