paulpas/agent-skill-router/maven-build-system

Claude Code and agent skill by paulpas/agent-skill-router

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Implements Apache Maven build configurations (POM structure, dependency management, profiles, multi-module builds, plugin configuration) for Java and Kotlin projects.

Install

npx vskill@latest install paulpas/agent-skill-router/maven-build-system

SKILL.md

The same SKILL.md was published earlier as paulpas/agent-skill-router/maven-build-system.

Maven Build System

Implements Apache Maven build configurations for Java and Kotlin projects — managing multi-module reactor builds, centralized dependency versioning with BOMs, plugin management, profile activation, and production-grade diagnostic workflows. When loaded, the model acts as a senior build engineer producing correct pom.xml files, resolving dependency conflicts, and diagnosing build issues using Maven's built-in diagnostics.

TL;DR Checklist

  • [ ] Use a parent POM with <dependencyManagement> and <pluginManagement> for all multi-module projects
  • [ ] Define a dedicated BOM module (packaging: pom) to centralize third-party dependency versions
  • [ ] Add maven-enforcer-plugin rules enforcing Java version, Maven version, and duplicate detection
  • [ ] Use ${project.version} instead of hardcoded version numbers in child POMs
  • [ ] Run mvn help:effective-pom and mvn dependency:tree -Dincludes=groupId:artifactId to diagnose issues
  • [ ] Set <scope>test</scope> on all test-scoped dependencies; never leave runtime deps as test scope
  • [ ] Use <exclusions> to resolve transitive dependency conflicts at the point of declaration

When to Use

Use this skill when:

  • Setting up a new Maven project or multi-module reactor from scratch
  • Resolving dependency version conflicts across modules using BOMs or dependencyManagement
  • Configuring Maven profiles for environment-specific builds (dev, staging, production)
  • Diagnosing build failures with effective-pom, dependency:tree, and enforcer rules
  • Migrating a non-Maven project to Maven or consolidating multiple projects into a reactor
  • Configuring plugin management to standardize compiler, test, and packaging behavior across modules

When NOT to Use

Avoid this skill for:

  • Non-Java/Kotlin projects — use gradle-build-system for Gradle-based builds instead
  • Simple single-file scripts — Maven's overhead is not justified for trivial build needs
  • Projects already committed to Gradle with convention plugins and Kotlin DSL
  • When only dependency resolution (not full build lifecycle) is needed — consider a dedicated tool like JBang or direct classpath management

Core Workflow

  1. Define Reactor Structure — Create a root pom.xml with <packaging>pom</packaging>, declare child modules via <modules>, and set the parent groupId/artifactId/version. Every child module must inherit these through a <parent> reference with <relativePath>../pom.xml</relativePath>.

Checkpoint: Run mvn help:evaluate -Dexpression=project.modules -q -DforceStdout to verify all modules are discovered. No child POM should declare its own groupId or version when inheriting from parent.

  1. Configure Dependency Management — In the parent POM, place all project dependency coordinates inside <dependencyManagement>. For shared third-party libraries (SLF4J, JUnit, Jackson), create a separate BOM module with pom packaging that centralizes versions. Child modules reference dependencies without version numbers — Maven resolves them from the parent's management section.

Checkpoint: Run mvn dependency:tree -Dincludes=com.fasterxml.jackson.core from the root. All modules must show exactly one Jackson version with no conflict warnings.

  1. Centralize Plugin Management — Declare plugin versions inside <build><pluginManagement> in the parent POM. Apply plugins to individual modules by listing them under each module's <build><plugins> section without specifying versions (they inherit from pluginManagement).

Checkpoint: Run mvn help:effective-pom -pl :my-service and verify that maven-compiler-plugin version matches your declared value. Maven must not emit "Plugin management" warnings about unmanaged plugins.

  1. Enforce Build Policies — Add the maven-enforcer-plugin with at least three rules: enforceJavaVersion, enforceMavenVersion, and banDuplicatePomDependencies. Configure failure behavior to stop the build on violations.

Checkpoint: Run mvn enforcer:enforce from the root in a clean checkout — it must pass. Then intentionally inject a duplicate dependency in one module and verify it fails with a clear error message naming the duplicate artifacts.

  1. Verify Reactor Build — Execute mvn clean verify from the reactor root. Review the output for version convergence warnings, plugin conflicts, or missing dependencies. The build exit code must be 0.

Checkpoint: Confirm that all modules compile, all tests pass, and no module shows [WARNING] Found dependency conflict. Check that inter-module dependencies resolve correctly (e.g., my-api depends on my-core, my-service depends on my-api).

  1. Diagnostic Resolution — When builds fail or behave unexpectedly, use Maven's diagnostic commands: mvn help:effective-pom to see the resolved POM after interpolation and inheritance, mvn dependency:tree -Dverbose for full transitive resolution details, and mvn help:evaluate -Dexpression=propertyName to inspect property values.

Checkpoint: Every dependency conflict must have an explicit <exclusion> in the module that introduces it, accompanied by a comment explaining why.


Implementation Patterns / Reference Guide

Pattern 1: Parent POM with Dependency and Plugin Management

A parent POM defines shared configuration while child modules inherit and specialize. The reactor build processes all modules in declaration order, resolving inter-module dependencies automatically.

xml
<!-- Root pom.xml — Maven multi-module parent (Maven 3.9+) -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Platform Parent</name>
<description>Parent POM for the My Platform multi-module project</description>
<modules>
<module>my-core</module>
<module>my-api</module>
<module>my-service</module>
<module>my-web</module>
<module>my-bom</module>
</modules>
<!-- Centralized dependency versions -->
<dependencyManagement>
<dependencies>
<!-- Internal modules — no version needed in children (inherit from parent) -->
<dependency>
<groupId>com.example</groupId>
<artifactId>my-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-api</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Third-party dependencies with centralized versions -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Plugin versions centralized here -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>21</release>
<parameters>true</parameters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- Properties for version management -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>21</maven.compiler.release>
</properties>
</project>
Pattern 2: Child Module POM with Dependencies

Child modules inherit everything from the parent. They only declare their own specific dependencies and plugin executions, never specifying versions for managed dependencies.

xml
<!-- my-service/pom.xml — A child module -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Inherits groupId, version, and all management sections from parent -->
<parent>
<groupId>com.example</groupId>
<artifactId>my-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>my-service</artifactId>
<name>My Service Module</name>
<description>Core business logic for the service layer</description>
<!-- Dependencies: version omitted — resolved from parent's dependencyManagement -->
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Exclude Log4j-over-SLF4j — causes classloader conflicts in Spring Boot -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.24.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.3.232</version>
<scope>test</scope>
</dependency>
</dependencies>

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 93 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Jul 2026, 4 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/paulpas/agent-skill-router/maven-build-system/badge)](https://verified-skill.com/skills/paulpas/agent-skill-router/maven-build-system)

Something wrong with this skill or its page? Tell us.