返回 Skill 列表
extension
分类: 开发与工程无需 API Key

112-java-maven-plugins

当你需要在pom.xml中添加或配置Maven插件时使用——包括质量工具(enforcer、surefire、failsafe、jacoco、pitest、spotbugs、pmd)、安全扫描(OWASP)、代码格式化(Spotless)、版本管理、构建信息跟踪和基准测试(JMH)——通过一种咨询式的、模块化的逐步方法,只添加你实际需要的内容。属于skills-for-java项目的一部分

person作者: jakexiaohubgithub

Maven Plugins: pom.xml Configuration Best Practices

Configure Maven plugins and profiles in pom.xml using a structured, question-driven process that preserves existing configuration. This is an interactive SKILL.

Prerequisites: Run ./mvnw validate or mvn validate before applying any plugin recommendations. If validation fails, stop and ask the user to fix issues — do not proceed until resolved.

Core areas: Existing configuration analysis and preservation, Maven Wrapper verification, project assessment questions (project nature, Java version, build and quality aspects), properties configuration, Maven Enforcer, Surefire, Failsafe, HTML test reports, JaCoCo coverage, PiTest mutation testing, OWASP security scanning, SpotBugs/PMD static analysis, SonarQube/SonarCloud, Spotless code formatting, Versions plugin, Git Commit ID, Flatten plugin, JMH benchmarking, Maven Compiler, and cyclomatic complexity analysis.

Multi-step scope: Begin with Step 1 (existing configuration analysis) before any changes. Ask project assessment questions one-by-one in Step 3, then execute only the plugin steps relevant to user selections. Never remove or replace existing plugins; only add new ones that do not conflict.

Before applying changes: Read the reference for detailed plugin configurations, XML templates, and constraints for each step.

Reference

For detailed guidance, examples, and constraints, see references/112-java-maven-plugins.md.