pom-ordering

Reorder Maven POM dependencies by scope and groupId with region comments.

14|4|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/motlin/claude-code-plugins --skill pom-ordering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pom-ordering
Source: https://github.com/motlin/claude-code-plugins/tree/main/plugins/java/skills/pom-ordering
Command: npx skills add https://github.com/motlin/claude-code-plugins --skill pom-ordering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent pom.xml dependency ordering leads to messy, hard-to-read, and difficult-to-maintain Maven projects. This Skill standardizes your pom.xml files, reducing cognitive load and merge conflicts.

Core Features & Use Cases

  • Strict Ordering Rules: Enforces consistent grouping of dependencies by scope (compile, runtime, test) and then by groupId.
  • Region Comment Structure: Guides the use of XML region comments (<!--region ... -->) for clear, hierarchical organization within pom.xml.
  • Nested Organization: Supports nested regions for further granularity within specific dependency groups (e.g., Liftwizard bundles).
  • Use Case: Automatically reorder and structure the dependencies in your pom.xml files to match best practices, ensuring consistency across all your Java projects and making them easier to navigate and maintain.

Quick Start

Reorder the dependencies in the current pom.xml file according to the standard rules.

Frequently Asked Questions about pom-ordering

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

FAQPage Schema
How do I organize dependencies in a Maven pom.xml file?

Maven pom.xml files should organize dependencies by scope (compile, runtime, test) and then by groupId using region comments. This Skill enforces that structure automatically, grouping first-party dependencies, then third-party libraries like Liftwizard and Dropwizard, creating a consistent, readable hierarchy that reduces merge conflicts.

Why should I use region comments to structure Maven dependencies?

Region comments mark logical dependency groups in pom.xml, making files easier to navigate and maintain. They separate concerns—compile dependencies from test dependencies, first-party from third-party—so developers quickly find what they need without scanning the entire dependency list.

Can I automatically reorder dependencies in my pom.xml?

Yes. This Skill automatically reorders and structures pom.xml dependencies according to standard grouping rules: by scope first, then by groupId, with region comments marking each section. It applies these rules consistently across your Maven projects without manual intervention.

What's the best way to handle nested dependency groups in Maven?

Nested regions support granular organization within dependency groups—for example, separating Liftwizard runtime dependencies from Liftwizard config dependencies. This Skill applies nested region blocks to keep related libraries grouped while maintaining the larger scope and groupId hierarchy.

How does dependency ordering reduce merge conflicts in Maven projects?

Inconsistent ordering causes developers to add dependencies in different positions, creating merge conflicts. Enforcing strict ordering—by scope, then groupId, with region comments—ensures all contributors place dependencies in the same location, eliminating conflicts and keeping pom.xml stable.

Does this work with multi-module Maven projects?

Yes. The Skill recognizes first-party dependencies using ${project.groupId} and project modules, placing them first in the dependency order. This ensures module interdependencies are clearly separated from third-party libraries in multi-module builds.