Skip to main content
Alison Aquinas logoAlison's LLM Skills Marketplace

maven

Included in skill bundleci-cdView on GitHub ↗

Files

SKILL.mdagentsreferences

Install

Install only this skill with npx skills
npx skills add alisonaquinas/llm-ci-dev --skill 'maven' -g -y
Install the containing skill bundle
/plugin install ci-cd@llm-skills
Download maven-skill.zip
This skill is bundled inside ci-cd. Use npx skills when you only want this skill, or install the bundle once to make every included skill available through the plugin marketplace flow. Browse the full skill bundle repository at github.com/alisonaquinas/llm-ci-dev.

Invoke

Invoke this skill after installation
/ci-cd:maven

SKILL.md


name: maven description: Build and manage Java projects with Apache Maven. Use when tasks mention mvn commands, pom.xml, dependency management, lifecycle phases, or Maven plugins.

Maven

Intent Router

RequestReferenceLoad When
Install tool, first-time setup, Maven wrapperreferences/install-and-setup.mdMaven needs to be installed or the mvnw wrapper configured
pom.xml structure, dependencies, pluginsreferences/pom-xml.mdWork involves editing pom.xml, adding dependencies, or configuring plugins
CLI commands, build workflowsreferences/command-cookbook.mdSpecific mvn commands or flags are needed
Lifecycle phases, common pluginsreferences/lifecycle-and-plugins.mdQuestions about build lifecycle or plugin configuration arise

Quick Start

# Validate project (check pom.xml)
mvn validate

# Compile source code
mvn compile

# Run tests
mvn test

# Package (creates JAR/WAR)
mvn package

# Install to local repository
mvn install

Core Command Tracks

  • Validate: mvn validate — checks pom.xml is well-formed before any build steps
  • Compile: mvn compile — compiles main source under src/main/java
  • Test: mvn test — runs unit tests via Surefire plugin
  • Package: mvn package — produces JAR or WAR artifact in target/
  • Verify: mvn verify — runs integration tests via Failsafe plugin after packaging
  • Install: mvn install — copies artifact to local ~/.m2/repository
  • Deploy: mvn deploy — uploads artifact to remote repository
  • Clean: mvn clean — removes target/ directory
  • Dependency tree: mvn dependency:tree — displays resolved dependency graph
  • Skip tests: append -DskipTests only when necessary (e.g., quick local packaging)

Safety Guardrails

  • Run mvn validate before any deploy operation to catch malformed pom.xml early.
  • Use --batch-mode (-B) in CI pipelines to suppress interactive prompts and produce consistent output.
  • Never skip tests in production pipelines; -DskipTests is reserved for specific local scenarios.
  • Prefer the mvnw (Maven wrapper) script when present — it guarantees a consistent Maven version across environments.
  • Avoid committing ~/.m2/settings.xml secrets to version control; use CI secret injection instead.
# Troubleshoot dependency conflicts: inspect the tree and resolve duplication
mvn dependency:tree -Dincludes=com.fasterxml.jackson.core
mvn dependency:analyze

Related Skills

  • gradle — alternative JVM build tool using Groovy/Kotlin DSL
  • ci-architecture — integrating Maven builds into CI/CD pipelines
  • aws — deploying Maven-built artifacts to AWS services

References

← Back to marketplace