- Multi-module Maven repo with root
pom.xmland service modules likeapollo-configservice,apollo-adminservice, andapollo-portal, shared libs inapollo-common, and packaging inapollo-assembly. apollo-bizis a shared business-logic module used by services like config/admin (not a standalone service).- Build and release tooling lives in
scripts/(e.g.,scripts/build.sh) andapollo-buildtools/(code style configs). - Database and schema assets are under
scripts/sqland modulesrc/main/resourcesfolders. - Tests follow standard Maven layout:
*/src/test/javaand*/src/test/resourcesinside each module. - Documentation is in
docs/.
./mvnw -DskipTests packagebuilds all modules../mvnw testruns the full test suite via Surefire (may log warnings if local meta/admin services are not running)../mvnw -pl apollo-configservice -am testruns tests for a specific module and its dependencies../mvnw spotless:applyformats code and must be run before opening a PR../scripts/build.shgenerates distributable packages (used for deployment workflows).
- Follow Google Java Style Guide; 2-space indentation and standard Java conventions apply.
- Use the IDE configs in
apollo-buildtools/style/(IntelliJ/Eclipse). - New Java classes should include a short Javadoc describing the class purpose.
- Use standard Java naming: packages
lower.case, classesUpperCamelCase, tests*Test.
- Treat OpenAPI as contract-first: update spec in
apolloconfig/apollo-openapibefore (or together with) portal implementation changes. apollo-portal/pom.xmlusesapollo.openapi.spec.url+openapi-generator-maven-plugin; generated sources undertarget/generated-sources/openapi/src/main/javaare added to compile path viabuild-helper-maven-plugin.- For new/changed OpenAPI endpoints, prefer implementing generated
*ManagementApiinterfaces and generated models; avoid introducing hand-written DTO/controller contracts that bypass the spec pipeline. - In PR review, verify contract alignment explicitly: endpoint path, request/response model, and permissions in
apolloshould match the spec inapollo-openapi.
- JUnit 5 is the default, with Vintage enabled for legacy JUnit 4 tests.
- Put new tests under the module’s
src/test/javawith*Testsuffix. - Add unit tests for new features or important bug fixes.
- Use Conventional Commits format (e.g.,
feat:,fix:). - If a commit fixes an issue, append
Fixes #123in the commit message. - Commit only on feature branches; never commit directly to
masterormain. CHANGES.mdentries must use a PR URL in Markdown link format; if the PR URL is not available yet, open the PR first, then add/updateCHANGES.mdin a follow-up commit.- Rebase onto
masterand squash feature work into a single commit before merge. - When merging a PR on GitHub: if it has a single commit, use rebase and merge; if it has multiple commits, use squash and merge.
- Non-trivial contributions require signing the CLA.
- Open a feature branch for your change and submit a PR using
.github/PULL_REQUEST_TEMPLATE.md. - PRs should include a clear description, tests run, and any relevant screenshots/logs; use GitHub issues for tracking.
- The PR checklist expects
mvn clean test,mvn spotless:apply, and an update toCHANGES.md. - For upstream contributions, open PRs against
apolloconfig/apolloand fill the template with real content (not the raw template text).
- Apollo supports H2 in-memory for local development and MySQL for production; prefer H2 locally unless you need a real database.
- Review
scripts/sqland environment config when using MySQL. - Do not commit secrets or environment-specific credentials; use local overrides instead.
- Follow
SECURITY.mdfor vulnerability reporting.