Runbook¶
Deploy¶
- Build:
make buildormvn -s settings.xml clean package -DskipIntegration=true - Run migrations:
make migrate(or./migrate.shwith env vars set) - Start:
java -jar target/boilerplate-0.1.0.jar --spring.profiles.active=local - Or use Docker:
docker compose -f docker-compose-local.yml up -d
Health checks¶
- Liveness:
GET http://localhost:8081/health/liveness - Readiness:
GET http://localhost:8081/health/readiness - App ping:
GET http://localhost:8080/health
Migrations¶
Multi-tenant Flyway layout:
src/main/resources/db/migration/common/— shared schemasrc/main/resources/db/migration/<tenant>/— tenant-specific seeds
Run make migrate (loads .env) or ./migrate.sh with SCHEMAS_TO_MIGRATE set.
Observability¶
- Prometheus scrape:
http://localhost:8081/metrics - Clear caches:
POST http://localhost:8081/cache-evict - Logs: JSON to stdout with
tidandcidcorrelation fields
Troubleshooting¶
| Symptom | Check |
|---|---|
| 400 No tenant present | Send header X-Default-Tenant: default |
| DB connection refused | docker compose ps, verify DB_HOST in .env |
| Kafka publish fails | Ensure Kafka is up (make docker-up) and KAFKA_HOST is set |
| Build uses wrong JDK | java -version must show 21; set JAVA_HOME |
| Maven cannot resolve deps | Use ./mvnw -s settings.xml (project settings use Maven Central) |
Security¶
- JWT disabled by default. Enable with
spring.security.enabled=trueand setsecurity.jwt.secret. - Run OWASP check before release:
make dependency-checkormake security