← スキル一覧に戻る

java-build-maven
by HZeroxium
⭐ 0🍴 0📅 2026年1月21日
SKILL.md
name: java-build-maven description: Standardize a Maven build for Java backend projects (parent POM, plugin management, profiles, enforcer rules, reproducible builds). Use when builds fail, adding modules, or pinning plugin versions. license: Apache-2.0 compatibility: "Any OS; Maven Wrapper recommended." metadata: version: "0.1.0" tags: ["java", "maven", "build", "multi-module", "enforcer"]
Java Build with Maven
Scope
In scope:
- Create/standardize parent POM and multi-module structure.
- Pin plugin versions via
pluginManagement. - Centralize dependency versions via
dependencyManagement(BOMs allowed). - Add Maven Enforcer rules for Java/Maven versions and dependency convergence.
- Define profiles for environments (dev/test/prod) if needed.
- Document reproducible build steps.
Out of scope:
- CI pipeline authoring (only provide commands).
- Framework-specific starters unless requested.
- Rewriting code unrelated to build.
When to use
- Build fails or behaves inconsistently across machines.
- Adding modules; migrating to multi-module reactor.
- Needing strict plugin/dependency version control.
- Security reviews requiring pinned build toolchain behavior.
Inputs
- Current
pom.xml(s), module list, publishing requirements. - Target Java version(s) and runtime constraints.
- Existing profiles and settings (private repos, proxies).
Procedure
-
Wrapper + baseline
- Ensure Maven Wrapper exists (
./mvnw) and is the canonical entrypoint. - Ensure
.mvn/config exists for consistent JVM flags if needed.
- Ensure Maven Wrapper exists (
-
Reactor structure (multi-module)
- Create a root
pom.xmlpackagingpom. - Define
<modules>list. - Move shared configuration to parent.
- Create a root
-
Dependency governance
- Use
<dependencyManagement>to pin versions. - Use BOMs where appropriate.
- Ensure no module declares arbitrary versions when managed.
- Use
-
Plugin governance
- Pin plugin versions in
<pluginManagement>. - Ensure surefire/failsafe versions are pinned.
- Keep compiler plugin aligned with target Java version.
- Pin plugin versions in
-
Enforcer hardening
- Add Enforcer with rules:
- RequireMavenVersion
- RequireJavaVersion
- DependencyConvergence (or equivalent)
- Fail fast with actionable messages.
- Add Enforcer with rules:
-
Profiles (optional)
- Use profiles for environment-specific settings only.
- Avoid profiles that change core dependency graphs unexpectedly.
-
Documentation
- Update README with canonical commands:
./mvnw -q test./mvnw -q -DskipTests package./mvnw -q -P<profile> verify(if profiles exist)
- Update README with canonical commands:
Outputs
- Parent POM + module POMs standardized.
- Enforcer rules added.
- Reproducible build steps documented.
DoD
- Clean checkout builds with
./mvnw -q test. - Modules are listed and build in reactor order.
- Dependencies and plugins are pinned/governed.
- Enforcer catches wrong Java/Maven versions early.
Guardrails
- Do not introduce too many profiles; keep them minimal.
- Do not allow unmanaged dependency versions without explicit reason.
- Do not weaken enforcer rules to “make it pass” without root-cause analysis.
Failure modes & fixes
- "Different results across machines" → missing wrapper/pinned plugins → add wrapper + pluginManagement.
- "Dependency diamond conflicts" → no convergence checks → add enforcer + dependencyManagement.
- "CI uses wrong Java" → missing RequireJavaVersion → enforce and document.
References
- See
templates/for parent/module POM examples and.mvn/config. - See
references/for profile and plugin governance playbooks.
スコア
総合スコア
40/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です