112-java-maven-plugins
Skill452 starsChanged 3 months agoApache-2.0View on GitHub
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) — through a consultative, modular step-by-step approach that only adds what you actually need. This should trigger for requests such as Add Maven plugins in pom.xml; Improve Maven plugins in pom.xml; Configure Maven quality plugins in pom.xml; Add Maven build lifecycle plugins for Java verification; Review Maven plugin versions and executions. Part of Plinth Toolkit
We split this skill into the rules it gives an agent
37 rules. About 0 are common, 15 are distinctive, and 22 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
22
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Before applying plugin recommendations, ensure the project is in a valid state.
- Very specific: line 42
MANDATORY: Run ./mvnw validate or mvn validate before applying any plugin recommendations
- Distinctive: line 43
SAFETY: If validation fails, stop and ask the user to fix issues—do not proceed until resolved
- Very specific: line 45
BEFORE READING PLUGIN REFERENCES: Run the question flow embedded in this SKILL.md first.
- Distinctive: line 49
Add Maven plugins in pom.xml
- Distinctive: line 52
Add Maven build lifecycle plugins for Java verification
- Very specific: line 59
Run ./mvnw validate or mvn validate and stop if validation fails.
- Very specific: line 64
Before making any changes to pom.xml:
- Distinctive: line 71
Ask the user before enhancing any existing plugin, property, reporting entry, support file, or profile.
- Distinctive: line 78
Check for Maven Wrapper files in the project root:
- Distinctive: line 83
If Maven Wrapper is not present, stop and ask:
- Distinctive: line 87
Wait for the user's response before asking any other question.
- Distinctive: line 97
Run this XML-included question flow before reading any plugin/profile implementation reference.
- Distinctive: line 143
Note: When "Cyclomatic Complexity" is selected, Step 20 will create a PMD ruleset file and profile.
- Distinctive: line 168
Question 5: Do you want to configure Sonar/SonarCloud integration?
- Distinctive: line 188
Must be unique within your Sonar organization
- Distinctive: line 214
After all applicable questions are answered, confirm the selections and map them to references:
- Very specific: line 216
If Maven Compiler is selected, read references/112-java-maven-plugins-maven-compiler-plugin.md.
- Very specific: line 217
If Maven Enforcer is selected, read references/112-java-maven-plugins-maven-enforcer-plugin.md.
- Very specific: line 218
If Unit Testing (Surefire) is selected, read references/112-java-maven-plugins-maven-surefire-plugin.md.
- Very specific: line 219
If Integration testing (Failsafe) is selected, read references/112-java-maven-plugins-maven-failsafe-plugin.md.
- Very specific: line 220
If Unit Testing Reports (Surefire Reports) is selected, read references/112-java-maven-plugins-maven-surefire-report-plugin.md and …
- Very specific: line 221
If Format source code (Spotless) is selected, read references/112-java-maven-plugins-spotless-maven-plugin.md.
- Very specific: line 222
If Version management is selected, read references/112-java-maven-plugins-versions-maven-plugin.md.
- Very specific: line 223
If build information tracking is selected, read references/112-java-maven-plugins-git-commit-id-maven-plugin.md.
- Very specific: line 224
If the project is a Java Library, read references/112-java-maven-plugins-flatten-maven-plugin.md.
- Very specific: line 225
If Container image build (Jib) is selected, read references/112-java-maven-plugins-jib-maven-plugin.md.
- Very specific: line 226
If Dependency analysis is selected, read references/112-java-maven-plugins-maven-dependency-plugin.md.
- Very specific: line 227
If Code coverage reporting (JaCoCo) is selected, read references/112-java-maven-plugins-profile-jacoco.md.
- Very specific: line 228
If Mutation testing (PiTest) is selected, read references/112-java-maven-plugins-profile-pitest.md.
- Very specific: line 229
If Security vulnerability scanning (OWASP) is selected, read references/112-java-maven-plugins-profile-security.md.
- Very specific: line 230
If Security static code analysis (SpotBugs, PMD) is selected, read references/112-java-maven-plugins-profile-static-analysis.md.
- Very specific: line 231
If Sonar is selected, read references/112-java-maven-plugins-profile-sonar.md.
- Very specific: line 232
If JMH is selected, read references/112-java-maven-plugins-profile-jmh.md.
- Very specific: line 233
If Cyclomatic Complexity is selected, read references/112-java-maven-plugins-profile-cyclomatic-complexity.md.
- Distinctive: line 234
Do not read or apply unselected plugin/profile references.
- Distinctive: line 239
Add selected plugins and profiles without removing existing ones, preserving project structure and compatibility.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
What is covered in this Skill?
Maven plugins:
- Maven Compiler
- Maven Enforcer
- Maven Surefire
- Maven Failsafe
- HTML test reports (Surefire Report, JXR)
- Maven Spotless
- Maven Flatten
- Maven Versions
- Maven Git Commit ID
- Maven Jib
Maven profiles:
- JaCoCo (code coverage)
- PiTest (mutation testing)
- Security (OWASP dependency check)
- Static analysis (SpotBugs, PMD)
- SonarQube/SonarCloud
- JMH (Java Microbenchmark Harness)
- Cyclomatic complexity
Constraints
Before applying plugin recommendations, ensure the project is in a valid state. Use a structured, question-driven process that preserves existing configuration and adds only what the user selects.
- MANDATORY: Run
./mvnw validateormvn validatebefore applying any plugin recommendations - SAFETY: If validation fails, stop and ask the user to fix issues—do not proceed until resolved
- SCOPE: Begin with Step 1 (existing configuration analysis) before any changes. Never remove or replace existing plugins; only add new ones that do not conflict
- BEFORE READING PLUGIN REFERENCES: Run the question flow embedded in this SKILL.md first. Ask questions one-by-one in strict order, collect all selected plugins/profiles and conditional values, then read only the implementation references selected by the user's answers
When to use this skill
- Add Maven plugins in pom.xml
- Improve Maven plugins in pom.xml
- Configure Maven quality plugins in pom.xml
- Add Maven build lifecycle plugins for Java verification
- Review Maven plugin versions and executions
Workflow
- Validate project before plugin changes
Run ./mvnw validate or mvn validate and stop if validation fails.
- Analyze current plugin and profile configuration
Before making any changes to pom.xml:
- Scan existing plugins in
<build><plugins>,<build><pluginManagement>, and<reporting><plugins>. - Scan existing properties in
<properties>. - Scan existing profiles in
<profiles>. - Identify conflicts between existing configuration and possible additions.
- Preserve all existing plugins, properties, and profiles.
- Ask the user before enhancing any existing plugin, property, reporting entry, support file, or profile.
- Skip duplicate additions unless the user explicitly requests an enhancement.
- Check Maven Wrapper before plugin changes
Check for Maven Wrapper files in the project root:
mvnwandmvnw.cmd.mvn/wrapper/maven-wrapper.properties
If Maven Wrapper is not present, stop and ask:
"I notice this project doesn't have Maven Wrapper configured. The Maven Wrapper ensures everyone uses the same Maven version, improving build consistency across different environments. Would you like me to install it? (y/n)"
Wait for the user's response before asking any other question. If the user says "y", install it:
mvn wrapper:wrapper- Ask Maven plugin assessment questions before reading references
Run this XML-included question flow before reading any plugin/profile implementation reference. Ask one question at a time, wait for the user's answer, and record selected plugins, profiles, and conditional values before continuing.
Question 1: What type of Java project is this?
Options:
- Java Library (for publishing to Maven Central/Nexus)
- Java CLI Application (command-line tool)
- Java Microservice (Web service/REST API/Modular monolith)
- Serverless (AWS Lambdas, Azure Functions)
- Java POC (Proof of Concept)
- Other (specify)
Question 2: Which Java version does your project target?
Options:
- Java 17 (LTS - recommended for new projects)
- Java 21 (LTS - latest LTS version)
- Java 25 (LTS - latest LTS version)
- Other (specify version)
Question 3: What build and quality aspects are important for your project?
Options:
- Format source code (Spotless)
- Maven Enforcer
- Unit Testing (Surefire)
- Unit Testing Reports (Surefire Reports)
- Integration testing (Failsafe)
- Code coverage reporting (JaCoCo)
- Mutation testing (PiTest)
- Security vulnerability scanning (OWASP)
- Security static code analysis (SpotBugs, PMD)
- Sonar
- Dependency analysis (maven-dependency-plugin)
- Version management
- Container image build (Jib)
- JMH (Java Microbenchmark Harness)
- Maven Compiler
- Cyclomatic Complexity
Note: When "Cyclomatic Complexity" is selected, Step 20 will create a PMD ruleset file and profile. The ruleset location depends on project structure: src/main/pmd/pmd-cyclomatic-complexity.xml (mono-module) or pmd/pmd-cyclomatic-complexity.xml (multi-module).
Question 3.1 (conditional): What is your target container image for Jib?
Note: This question is only asked if "Container image build (Jib)" was selected in question 3.
- Example format:
gcr.io/my-project/my-app,docker.io/username/myimage, ormyimagefor local Docker - The image name will be used in the Jib plugin
<to><image>configuration
Question 4: What is your target coverage threshold?
Options:
- 70% (moderate)
- 80% (recommended)
- 90% (high)
- Custom percentage (specify)
Note: This question is only asked if "Code coverage reporting (JaCoCo)" was selected in question 3.
Question 5: Do you want to configure Sonar/SonarCloud integration?** (y/n)
Note: This question is only asked if "Static code analysis (SpotBugs, Sonar)" was selected in question 3.
If yes, please provide the following information:
Question 5.1: What is your Sonar organization identifier?
- For SonarCloud: This is typically your GitHub username or organization name
- For SonarQube: This is your organization key as configured in SonarQube
- Example:
my-github-userormy-company-org
Question 5.2: What is your Sonar project key?
- For SonarCloud: Usually in format
GITHUB_USER_REPOSITORY_NAME(e.g.,john-doe_my-java-project) - For SonarQube: Custom project key as defined in your SonarQube instance
- Must be unique within your Sonar organization
- Example:
john-doe_awesome-java-lib
Question 5.3: What is your Sonar project display name?
- Human-readable name for your project as it appears in Sonar dashboard
- Can contain spaces and special characters
- Example:
Awesome Java LibraryorMy Microservice API
Question 5.4: Which Sonar service are you using? (conditional)
Note: This question is only asked if Sonar configuration was enabled in question 5.
Options:
- SonarCloud (https://sonarcloud.io) - recommended for open source projects
- SonarQube Server (specify your server URL)
If SonarQube Server: Please provide your SonarQube server URL (e.g., https://sonar.mycompany.com)
After all applicable questions are answered, confirm the selections and map them to references:
- If Maven Compiler is selected, read
references/112-java-maven-plugins-maven-compiler-plugin.md. - If Maven Enforcer is selected, read
references/112-java-maven-plugins-maven-enforcer-plugin.md. - If Unit Testing (Surefire) is selected, read
references/112-java-maven-plugins-maven-surefire-plugin.md. - If Integration testing (Failsafe) is selected, read
references/112-java-maven-plugins-maven-failsafe-plugin.md. - If Unit Testing Reports (Surefire Reports) is selected, read
references/112-java-maven-plugins-maven-surefire-report-plugin.mdandreferences/112-java-maven-plugins-maven-jxr-plugin.md. - If Format source code (Spotless) is selected, read
references/112-java-maven-plugins-spotless-maven-plugin.md. - If Version management is selected, read
references/112-java-maven-plugins-versions-maven-plugin.md. - If build information tracking is selected, read
references/112-java-maven-plugins-git-commit-id-maven-plugin.md. - If the project is a Java Library, read
references/112-java-maven-plugins-flatten-maven-plugin.md. - If Container image build (Jib) is selected, read
references/112-java-maven-plugins-jib-maven-plugin.md. - If Dependency analysis is selected, read
references/112-java-maven-plugins-maven-dependency-plugin.md. - If Code coverage reporting (JaCoCo) is selected, read
references/112-java-maven-plugins-profile-jacoco.md. - If Mutation testing (PiTest) is selected, read
references/112-java-maven-plugins-profile-pitest.md. - If Security vulnerability scanning (OWASP) is selected, read
references/112-java-maven-plugins-profile-security.md. - If Security static code analysis (SpotBugs, PMD) is selected, read
references/112-java-maven-plugins-profile-static-analysis.md. - If Sonar is selected, read
references/112-java-maven-plugins-profile-sonar.md. - If JMH is selected, read
references/112-java-maven-plugins-profile-jmh.md. - If Cyclomatic Complexity is selected, read
references/112-java-maven-plugins-profile-cyclomatic-complexity.md. - Do not read or apply unselected plugin/profile references.
- Read selected references and add only selected configuration
Add selected plugins and profiles without removing existing ones, preserving project structure and compatibility. Add only the Maven properties, plugin configuration, profile configuration, reporting plugins, and support files required by the selected references.
- Summarize applied plugin setup
Report added plugins/profiles, rationale, and recommended follow-up commands or checks.
Reference
For detailed guidance, examples, and constraints, see:
- references/112-java-maven-plugins-maven-compiler-plugin.md
- references/112-java-maven-plugins-maven-enforcer-plugin.md
- references/112-java-maven-plugins-maven-surefire-plugin.md
- references/112-java-maven-plugins-maven-failsafe-plugin.md
- references/112-java-maven-plugins-maven-surefire-report-plugin.md
- references/112-java-maven-plugins-maven-jxr-plugin.md
- references/112-java-maven-plugins-spotless-maven-plugin.md
- references/112-java-maven-plugins-flatten-maven-plugin.md
- references/112-java-maven-plugins-versions-maven-plugin.md
- references/112-java-maven-plugins-git-commit-id-maven-plugin.md
- references/112-java-maven-plugins-jib-maven-plugin.md
- references/112-java-maven-plugins-maven-dependency-plugin.md
- references/112-java-maven-plugins-profile-jacoco.md
- references/112-java-maven-plugins-profile-pitest.md
- references/112-java-maven-plugins-profile-security.md
- references/112-java-maven-plugins-profile-static-analysis.md
- references/112-java-maven-plugins-profile-sonar.md
- references/112-java-maven-plugins-profile-jmh.md
- references/112-java-maven-plugins-profile-cyclomatic-complexity.md
Other versions2 projects use a version of this.
Word for word · 1
- jabrena/plinth★ 448100% same
Edited · 1
- jabrena/cursor-rules-examples★ 280% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- 001-commands-inventorySkill
- 002-agents-inventorySkill
- 003-skills-inventorySkill
- 004-commands-installationSkill
- 005-agents-installationSkill
- 012-agile-epicSkill
- 013-agile-featureSkill
- 014-agile-user-storySkill
- 021-problem-framingSkill
- 022-root-cause-analysisSkill
- 023-assumption-analysisSkill
- 024-context-mappingSkill
- 025-quality-attribute-discoverySkill
- 030-architecture-adr-generalSkill
- 033-architecture-diagramsSkill
- 041-planning-plan-modeSkill
- 042-planning-openspecSkill
- 043-planning-github-issuesSkill
- 044-planning-jiraSkill
- 045-planning-azure-devopsSkill
- 051-design-two-steps-methodsSkill
- 052-design-hamburger-methodSkill
- 053-design-simple-rulesSkill
- 054-design-tddSkill
- 055-design-parallel-changeSkill
- 056-design-avoid-breaking-changesSkill
- 057-design-feature-togglesSkill
- 058-design-bddSkill
- 059-design-atddSkill
- 110-java-maven-best-practicesSkill
- 111-java-maven-dependenciesSkill
- 113-java-maven-documentationSkill
- 114-java-maven-searchSkill
- 121-java-object-oriented-designSkill
- 122-java-type-designSkill
- 123-java-design-patternsSkill
- 124-java-secure-codingSkill
- 125-java-concurrencySkill
- 126-java-exception-handlingSkill
- 128-java-genericsSkill
- 130-java-testing-strategiesSkill
- 131-java-testing-unit-testingSkill
- 132-java-testing-integration-testingSkill
- 133-java-testing-acceptance-testsSkill
- 141-java-refactoring-with-modern-featuresSkill
- 142-java-functional-programmingSkill
- 143-java-functional-exception-handlingSkill
- 144-java-data-oriented-programmingSkill
- 145-java-refactoring-high-performanceSkill
- 151-java-performance-jmeterSkill
- 152-java-performance-gatlingSkill
- 161-java-profiling-detectSkill
- 162-java-profiling-analyzeSkill
- 163-java-profiling-refactorSkill
- 164-java-profiling-verifySkill
- 170-java-documentationSkill
- 181-java-observability-loggingSkill
- 182-java-observability-metrics-micrometerSkill
- 183-java-observability-tracing-opentelemetrySkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

