From java-skills
Use when working with Maven builds — editing pom.xml, structuring or building multi-module/multi-project (reactor) projects, managing dependencies/plugins/BOMs, cleaning up POM hygiene (scopes, ordering, redundant versions), upgrading Maven 3 to Maven 4, or running large mechanical migrations (Java version, Spring Boot, JUnit upgrades) where OpenRewrite recipes beat hand-editing. Load the reference files for multi-module details and the Maven 4 upgrade.
How this skill is triggered — by the user, by Claude, or both
Slash command
/java-skills:java-mavenThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Docs:** [Maven Wrapper](https://maven.apache.org/wrapper/)
Docs: Maven Wrapper · POM reference · CI-friendly versions · What's new in Maven 4
The house standard for Maven builds. Everyday conventions, POM hygiene, and migrations live here;
multi-module/reactor detail and the Maven 4 upgrade live in references/ (routing table below).
./mvnw, .mvn/wrapper/maven-wrapper.properties) so everyone builds
with the same Maven version. Pin it; don't rely on the machine's installed Maven.<pluginManagement> at the parent), and pin dependency versions
via <dependencyManagement> (or an imported BOM) — never leave versions to chance/transitive
resolution. Run mvn versions:display-plugin-updates / display-dependency-updates to review.mvn verify over mvn clean install. verify runs the full check (incl. integration
tests) without polluting the local repo; reserve install for when a downstream local build needs
the artifact.${revision} for a single source of truth across modules (built-in
in Maven 4; needs the flatten plugin in Maven 3 — see the upgrade reference)..mvn/wrapper/maven-wrapper.properties or mvn -v. Maven 4
requires Java 17 to run (it can still compile to older bytecode via the compiler release).
Don't use model-4.1.0-only POM features on a Maven 3 build.pom.xml ordered and minimal; don't duplicate a plugin/dependency declaration (Maven 4 fails
the build on duplicates that Maven 3 only warned about)../mvnw verify # the default full check — not clean install
./mvnw -pl :acme-api -am verify # one subproject plus everything it depends on
./mvnw versions:display-dependency-updates # review pins (also: display-plugin-updates)
Apply these to any POM you write or review:
<groupId> on every plugin; explicit versions everywhere (centralized in
*Management) — and conversely, children must not re-declare a version that
dependencyManagement/pluginManagement already provides.<scope>system</scope> — install the artifact into a repo instead.pom. expressions: ${artifactId}/${pom.version} → ${project.artifactId}/${project.version}.<scm> in
sync with the actual git origin.mvn dependency:analyze periodically: fix used-undeclared (add them) and
unused-declared (remove them) dependencies.For well-known mechanical migrations, don't hand-edit dozens of files — run the matching
OpenRewrite recipe, then review the diff and ./mvnw verify:
| Migration | Recipe (rewrite.activeRecipes) | Artifact |
|---|---|---|
| POM cleanup (the hygiene rules above) | org.openrewrite.maven.BestPractices | built in |
| Java upgrade (17/21/25) | org.openrewrite.java.migrate.UpgradeToJava21 (also ...UpgradeToJava17/...25) | rewrite-migrate-java |
| Spring Boot upgrade | org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5 (Boot 4: boot4.UpgradeSpringBoot_4_0) | rewrite-spring |
| JUnit 4 → 5 | org.openrewrite.java.testing.junit5.JUnit4to5Migration | rewrite-testing-frameworks |
| Maven 3 → 4 | use mvnup instead (ships with Maven 4) — see references/maven-4-upgrade.md | — |
Invoke the plugin directly (no POM changes); the dryRun goal first writes a rewrite.patch preview:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE \
-Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21
Recipes are a starting point, not gospel: review the diff, build, and test before committing.
| Situation | Read |
|---|---|
| Setting up or building part of a multi-module repo; reactor/build-order/BOM questions | references/multi-module.md |
Moving a build to Maven 4, or asked about <subprojects>, mvnup, model 4.1.0, consumer POM | references/maven-4-upgrade.md |
<pluginManagement> / <dependencyManagement>,
or a child re-declaring a managed version<scope>system</scope>; ${pom.*} or prefixless ${artifactId}-style expressions<subprojects>, root="true", bom packaging) on a Maven 3 buildProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mtkhawaja/java-skills --plugin java-skills