🎯

Maven

v1.7.0

Validation and quality enforcement for Apache Maven projects with dependency management, build lifecycle, and plugin configuration skills.

Installation

Install han binary (required for hooks to work):

curl -fsSL https://han.guru/install.sh | bash

Then install this plugin:

han plugin install jutsu-maven

Overview

Validation and quality enforcement for Apache Maven projects with comprehensive skills for dependency management, build lifecycle, and plugin configuration.

What This Jutsu Provides

Validation Hooks

  • Maven Validation: Runs mvn validate to ensure POM files are valid and the project can be built
  • Hooks run on Stop and SubagentStop events to catch issues before completion

Skills

This jutsu provides the following skills:

  • maven-dependency-management: Manage dependencies, resolve conflicts, configure BOMs, and optimize dependency trees
  • maven-build-lifecycle: Work with build phases, goals, profiles, and customize the build process
  • maven-plugin-configuration: Configure Maven plugins including compiler, surefire, jar, and quality plugins

Installation

Install with npx (no installation required):

han plugin install jutsu-maven

Usage

Once installed, this jutsu automatically validates your Maven projects:

  • When you finish a conversation with Claude Code
  • When Claude Code agents complete their work

The validation ensures your pom.xml files are correct and the project structure is valid.

Skills Overview

Dependency Management

Learn to effectively manage Maven dependencies:

  • Declare dependencies with proper groupId, artifactId, and version
  • Use dependency scopes (compile, provided, runtime, test)
  • Import BOMs for version management
  • Exclude transitive dependencies
  • Resolve version conflicts
  • Analyze dependency trees

Build Lifecycle

Master Maven's build lifecycle:

  • Understand phases (validate, compile, test, package, install, deploy)
  • Execute specific goals
  • Create and activate profiles
  • Configure resource filtering
  • Optimize multi-module builds
  • Set up CI/CD integration

Plugin Configuration

Configure essential Maven plugins:

  • Compiler Plugin for Java compilation settings
  • Surefire/Failsafe for test execution
  • JAR/WAR/Assembly for packaging
  • Enforcer for build rules
  • Checkstyle, SpotBugs, PMD for code quality
  • Spring Boot Plugin for Spring applications
  • Versions Plugin for dependency updates

Requirements

  • Apache Maven 3.8.0 or higher
  • Java 17 or higher (recommended)

Example Usage

Validate a Project

mvn validate

Build with Tests

mvn clean verify

Skip Tests

mvn install -DskipTests

View Dependency Tree

mvn dependency:tree

Check for Updates

mvn versions:display-dependency-updates
mvn versions:display-plugin-updates

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT License - See LICENSE for details.

Hooks

⚠

Token Usage Notice

Hooks run automatically during Claude Code sessions and their output is sent to the model for processing. This may increase token usage and associated costs. Consider disabling hooks you don't need via han-config.yml.

🛑

Stop

Runs when the main Claude Code agent has finished responding. Can verify task completion, check quality gates, or ensure documentation requirements are met before the session ends.

🛑

SubagentStop

Runs when a Claude Code subagent (Task tool call) has finished responding. Can validate subagent outputs, enforce quality standards, or trigger additional workflows after delegated tasks complete.