A clean, reusable Java 25 + Spring Boot 4.2.0 + Spring Modulith 2.2.0 Maven starter template with automated architecture, style, and modernization guardrails.
- Java 25 & Spring Boot 4.2.0 (Virtual Threads enabled, Web, Validation, Actuator
health,info) - Spring Modulith 2.2.0 with strict vertical module encapsulation (
<module>,<module>.web,<module>.internal) andModulithArchitectureTest - ArchUnit (
CodingRulesTest) forbiddingOptional.get(),Optionalfields/record components, andOptional@RestControllerparameters - Checkstyle (
checkstyle.xml) enforcing no star/unused/redundant imports and core Java cleanliness rules - OpenRewrite (
rewrite.yml) withio.fmalhe.CleanAndModernizeandio.fmalhe.NoStarImports(rewrite:dryRunfailsverifyif code is not clean) - Lombok (
lombok.configwithaddConstructorProperties = true) & JSpecify (@NullMarked/@Nullable) - Illustrative
samplemodule (GET /api/samples/{id}) demonstrating self-validating value objects, immutableOptional-getter responses, and@WebMvcTest - Multi-stage
Dockerfile(Eclipse Temurin 25 JDK/JRE, non-root user) AGENTS.mdwith concise engineering conventions for coding agents
- Create a new repository from this template (or clone and re-point
origin). - Update
<groupId>,<artifactId>,<name>, and<description>inpom.xml, andspring.application.nameinsrc/main/resources/application.yaml. - Rename the root package
io.fmalhe.app(and update the package string inCodingRulesTest) to match your service. - Replace or remove the
samplemodule with your own domain modules.
Requires JDK 25:
# Auto-clean imports and apply OpenRewrite modernization recipes
./mvnw test-compile rewrite:run
# Run all tests, Modulith verification, ArchUnit, Checkstyle, and rewrite:dryRun
./mvnw verify
# Run locally
./mvnw spring-boot:run
# Build container image
docker build -t spring-boot-template .