Thanks for helping improve this project! This guide explains the local dev setup, the formatting/licensing workflow, testing, and how to propose changes.
- Install prerequisites: JDK 17+, Maven 3.8+, Git.
- Clone the repo and create a branch:
git checkout -b my-fix. - Build locally: run
mvn clean installfrom the repo root. Spotless will apply formatting and license headers during the build. - Before pushing: run
mvn -DskipTests spotless:check checkstyle:check. - Open a PR with a clear title and description.
- This is a multi-module Maven project.
- Java 17 is the baseline.
- Build with
mvn -B verify(CI runs with-DskipTestsselectively when needed).
We use Spotless (Maven) to:
- Format Java with google-java-format.
- Insert/normalize license headers (the header content is defined inline in the parent POM’s
<licenseHeader>configuration).
Do not hand-format files or hand-edit headers; let Spotless do it. Running
mvn clean installlocally will mutate sources to match the standard.
We keep Checkstyle to enforce additional rules. CI fails if formatting or style checks fail.
-
JDK 17+
-
Maven 3.8+
-
Git
-
Optional IDE plugins:
- IntelliJ: Google Java Format plugin (for local editing experience). Spotless remains the source of truth.
- Run
mvn clean installfrom the repo root. During the build, Spotless applies formatting and license headers. - Before pushing, run
mvn -DskipTests spotless:check checkstyle:checkto ensure CI will pass.
- Unit tests:
mvn -q testormvn verify. - Integration tests (if defined): Use the dedicated Maven profile exposed by the module, e.g.
-Pintegration-tests. - Prefer fast, deterministic tests. Avoid time-sensitive sleeps; use time abstractions or awaitility-style utilities.
- Use clear, behavior-driven names:
methodName_shouldDoX_whenY. - Keep one logical assertion per test (or one behavior per test).
- Mock only external dependencies; don’t over-mock domain logic.
- Make tests independent; no ordering assumptions.
- Use short, descriptive names:
fix/formatter,feat/http-call,docs/contributing.
- Keep messages clear and imperative:
Fix header resolution for child modules. - Conventional Commits are welcome (
feat:,fix:,docs:,test:,refactor:). Example:feat: add A2A call task support.
-
Describe the problem, the solution, and any trade-offs.
-
Include before/after snippets or screenshots when relevant.
-
Link related issues.
-
Check the box:
-
mvn -DskipTests spotless:check checkstyle:checkpasses locally - Unit/integration tests updated
- Public API changes documented/Javadoc updated
- No unrelated formatting churn (Spotless should keep this minimal)
-
- Immutability first: prefer
finalfields and defensive copies. - Null-safety: use
Objects.requireNonNullat boundaries; considerOptionalfor truly optional returns (don’t use it for fields/params). - Exceptions: throw specific exceptions; include actionable messages; don’t swallow errors.
- Logging: use SLF4J; no
System.out.println; keep logs structured and at appropriate levels. - APIs: document with Javadoc; avoid breaking changes to public APIs unless necessary and called out in release notes.
- Generics & type-safety: prefer precise types over
Object; isolate unchecked casts. - Performance: avoid premature optimization; measure first; add micro-benchmarks (JMH) when optimizing hot paths.
- The license header is defined inline in the parent POM under Spotless’
<licenseHeader>. - To update it, edit the parent POM and run
mvn spotless:applyto propagate changes.
- CI runs
spotless:checkandcheckstyle:checkto ensure consistent formatting and style. - Builds fail if formatting or headers drift. Run
mvn spotless:applylocally to fix.
- Spotless changed files during build? That’s expected locally. Review
git status, then stage and commit the updates. - CI red on formatting? Run
mvn spotless:applylocally, commit, and push. - Running only a submodule? Prefer
mvn -pl <module> -am …from the repo root so parent config (Spotless/Checkstyle) is applied consistently.
Open a discussion or issue on the repository. Thanks for contributing! 🎉