No slash command · from java-foundation
Maven and Gradle build tool conventions for Java projects: detection, wrapper usage, dependency management with BOMs, plugin configuration, semver, and multi-module layouts.
Ships in java-foundation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Determine the build tool at the start of every task:
| Signal | Tool |
|---|---|
pom.xml exists | Maven |
build.gradle exists | Gradle (Groovy DSL) |
build.gradle.kts exists | Gradle (Kotlin DSL) |
Both pom.xml and build.gradle* | Unusual — flag and ask; never assume |
Never invoke mvn or gradle directly — use the wrapper so the team's pinned version runs.
# Maven
./mvnw <goal> # Unix
mvnw.cmd <goal> # Windows (if needed)
# Gradle
./gradlew <task>
If the wrapper is absent, flag it in DECISIONS and fall back to the system binary, but note that pinning is missing.
<!-- Declare versions in <properties> — never inline literals -->
<properties>
<java.version>21</java.version>
<mapstruct.version>1.6.3</mapstruct.version>
</properties>
<!-- Import a BOM in dependencyManagement to align a family of deps -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Declare individual deps without <version> when BOM covers them -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Never use LATEST or RELEASE as versions — they are non-reproducible. Pin explicitly or let a BOM manage.
./mvnw compile # compile only
./mvnw test # compile + test
./mvnw package -DskipTests # build JAR/WAR, skip tests
./mvnw verify # full build incl. integration tests
./mvnw dependency:tree # show resolved dependency tree
./mvnw versions:display-dependency-updates # check for outdated deps
Root pom.xml declares <packaging>pom</packaging> and <modules> list. Child modules inherit groupId and version from parent. Use <dependencyManagement> in root to align versions across modules — child modules do not repeat versions.
plugins {
java
application
}
group = "com.example"
version = "1.0.0"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
// Import a BOM (platform)
implementation(platform("io.quarkus:quarkus-bom:3.18.0"))
implementation("io.quarkus:quarkus-resteasy-reactive")
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.test {
useJUnitPlatform()
}
plugins {
id 'java'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
implementation platform('io.quarkus:quarkus-bom:3.18.0')
implementation 'io.quarkus:quarkus-resteasy-reactive'
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
./gradlew build # compile + test + assemble
./gradlew test # test only
./gradlew assemble # build without tests
./gradlew dependencies # dependency tree
./gradlew dependencyUpdates # with ben-manes/versions plugin
Prefer java { toolchain { ... } } over sourceCompatibility / targetCompatibility. The toolchain block pins the JDK version independently of the JDK running Gradle itself, ensuring reproducibility across machines.
<properties>, Gradle libs.versions.toml (version catalog), or the BOM.[1.0,), LATEST, RELEASE, +).lombok annotations if used).implementation / testImplementation / compileOnly)../mvnw dependency:tree or ./gradlew dependencies.<!-- Enforce minimum Maven version and dependency convergence -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce</id>
<goals><goal>enforce</goal></goals>
<configuration>
<rules>
<requireMavenVersion><version>3.8</version></requireMavenVersion>
<dependencyConvergence/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Do not add plugins that aren't already present unless the BA spec calls for it — document in DECISIONS.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
maven, gradle, java-build, dependency-management, multi-module
3 skills in this plugin
/java-conventionsModern Java idioms for any JVM project (Java 17+): records, sealed types, text blocks, pattern matching, Optional discipline, streams, immutability, null safety, package layout, var usage, and code organisation. Apply when the project is a Java 17+ project. Stack-agnostic — referenced by every Java plugin in the marketplace.
Use this skill to:
- Write self-documenting, immutable-by-default value types with records.
- Model closed type hierarchies with sealed classes and interfaces.
- Handle optionality explicitly with Optional instead of returning null.
- Write expressive pipelines with Stream API without performance footguns.
- Lay out packages consistently (feature-first or layer-first) and keep class responsibilities tight.
Do NOT use this skill for:
- Framework-specific idioms (Spring annotations, JPA mappings — those live in framework plugin skills).
- Build tooling (Maven/Gradle) — see java-foundation:build-tooling.
- Testing patterns — see java-foundation:jvm-testing.
/jvm-testingJUnit 5, Mockito, AssertJ, and Testcontainers patterns for any JVM project. Covers test structure, parameterised tests, mocking discipline, fluent assertions, and integration testing with real containers. Stack-agnostic — referenced by every Java plugin in the marketplace.
Use this skill to:
- Write clear, maintainable unit tests with JUnit 5.
- Mock dependencies with Mockito without overusing mocks.
- Write expressive assertions with AssertJ.
- Spin up real infrastructure (DBs, message brokers) with Testcontainers for integration tests.
Do NOT use this skill for:
- Spring-specific test slices (@SpringBootTest, @WebMvcTest, @DataJpaTest — those are in spring-boot-plugin skills).
- Framework-specific mocking utilities (MockMvc, WebTestClient).
npx claudepluginhub aratkruglik/claude-sdlc --plugin java-foundationOther plugins' skills for the same job