Java Checkstyle / Spotless
SkillFiles & storageA skill that runs `mvn spotless:apply` to fix Java checkstyle and formatting failures, then verifies the result. It is meant to be invoked after you author or modify any `.java` files, or when CI reports a "Java checkstyle failed" or "Fix Java checkstyle" issue on a pull request. It can also run in check-only mode to confirm the tree is clean without changing files.
Then ask your AI: use the Java Checkstyle / Spotless skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Have a Java project that uses the Spotless Maven plugin for formatting.
What your AI can do with it
- Run `mvn spotless:apply` at the repo root to reformat all Java modules
- Scope the fix to one Maven module with `-pl <module>`
- Run `mvn spotless:check` to verify formatting without writing files
- Review what changed with `git status --short` and `git diff --stat`
- Commit a purely mechanical reformat as a `Fix Java checkstyle` commit
- Surface plugin errors instead of hand-editing formatting around them
Getting started
- Have a Java project that uses the Spotless Maven plugin for formatting.
- Make sure Maven is available and the project builds from the repository root.
- Invoke the skill after editing `.java` files, or when CI reports a checkstyle failure.
- Optionally pass `-pl <module>` to scope the run, or `--check` to verify only.
- Review the changed files with git before deciding whether to commit.
What this skill tells your AI
The instructions your AI receives, as published by open-metadata/openmetadata in skills/java-checkstyle/SKILL.md and read by Ahel’s review.
OpenMetadata enforces Java formatting via the Spotless Maven plugin. Every CI
build runs mvn spotless:check and fails the PR if any file is not formatted.
This skill keeps the fix on a single, consistent command so reviewers never have
to ask for it manually again.
When to activate
- The user asks to "fix checkstyle", "fix Java formatting", "apply spotless", "run spotless", "format Java", or similar.
- CI posts a
Java checkstyle failed/Fix Java checkstylecomment on a PR (the project's bot phrases the instruction as "Please runmvn spotless:applyin the root of your repository and commit the changes to this PR"). - After you have finished authoring or editing any
.javafiles — before opening a PR or pushing a commit that touches Java.
Arguments
- No arguments: run
mvn spotless:applyat the repo root across all modules. -pl <module>: scope to a single Maven module (e.g.-pl openmetadata-service). Useful when only one module changed and you want a faster run.--check: runmvn spotless:checkinstead ofapply. Use to confirm the tree is clean without touching files (e.g. to verify before push).
Process
Step 1: Run Spotless
From the repo root:
mvn spotless:apply # default — formats everything
# or
mvn -pl <module> spotless:apply # scoped to one module
# or
mvn spotless:check # verify only, don't write
Spotless is fast (seconds, no compilation). If it fails with a plugin error (not a formatting diff), surface the error and stop — do not try to hand-edit formatting around the failure.
Step 2: Check what changed
git status --short
git diff --stat
Expect reformatting in .java files only. If Spotless touches pom.xml or
other non-Java files, that's also fine — Spotless is configured for those too
in this repo.
Step 3: Commit
Do not fold the reformat into an unrelated commit. If the user asked you to
commit, follow their preference (fold into the in-progress commit, or make a
separate one). Otherwise, when you are confident the change is a purely
mechanical formatting reformat, you may commit it on its own as a
Fix Java checkstyle commit — this matches the repo's existing history for
bot-triggered formatting-only commits. If you are unsure whether the diff is
purely mechanical, do NOT auto-commit: surface the changed-file list and let the
user decide.
Notes
- Spotless config lives in the root
pom.xml(spotless-maven-pluginsection) —googleJavaFormat+removeUnusedImports. Do not redefine formatting rules inline in source files. - If Spotless keeps rewriting a change you just made, re-read the config — Spotless is the source of truth, not the IDE.
- CI enforcement lives in
.github/workflows/java-checkstyle.yml: thejava-checkstylejob runsmvn spotless:applyand fails (git diff-files) if the tree was not already formatted, posting the "Please runmvn spotless:apply" comment.
Out of scope
- UI / TypeScript formatting — use the
ui-checkstyleskill (ESLint + Prettier + organize-imports); this skill is Java-only. - Python formatting — use
make py_format(ruff lint-fix + format; seeingestion/Makefile). (Note: this is ruff, not black/isort/pycln.)
Signals
- GitHub stars
- 15k
- Forks
- 2k
- Last commit
- Oct 2026
Questions
- What does this skill do?
- It runs `mvn spotless:apply` to reformat Java files that fail the project's checkstyle rules, reviews what changed with git, and can commit the reformat as a `Fix Java checkstyle` commit.
- When should I invoke it?
- After authoring or modifying any `.java` files, or when CI reports a "Java checkstyle failed" or "Fix Java checkstyle" issue on a pull request.
- Can I scope the fix to one module?
- Yes. Pass `-pl <module>` to run Spotless on a single Maven module, which is useful when only one module changed.
Advanced
- Item type
- skill
- Key
java-checkstyle- Source
- github.com/open-metadata/openmetadata
github.com/open-metadata/openmetadata
Related picks
Skill · a5c-ai
The pick for Java110-java-maven-best-practices
Skill · jabrena
The pick for Javadbos-python
Skill · sickn33
The pick for Pythonpython-design-patterns
Skill · wshobson
The pick for Pythonsetup-ts-deep-modules
Skill · mattpocock
The pick for TypeScripttypescript-providers
Skill · composiohq
The pick for TypeScript