Skip to content

About

Opinionated Java 25, Spring Boot 4.2, Spring Modulith, Lombok, Checkstyle, ArchUnit, and OpenRewrite Maven starter template

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Spring Boot Template

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.

What's Included

  • 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) and ModulithArchitectureTest
  • ArchUnit (CodingRulesTest) forbidding Optional.get(), Optional fields/record components, and Optional @RestController parameters
  • Checkstyle (checkstyle.xml) enforcing no star/unused/redundant imports and core Java cleanliness rules
  • OpenRewrite (rewrite.yml) with io.fmalhe.CleanAndModernize and io.fmalhe.NoStarImports (rewrite:dryRun fails verify if code is not clean)
  • Lombok (lombok.config with addConstructorProperties = true) & JSpecify (@NullMarked / @Nullable)
  • Illustrative sample module (GET /api/samples/{id}) demonstrating self-validating value objects, immutable Optional-getter responses, and @WebMvcTest
  • Multi-stage Dockerfile (Eclipse Temurin 25 JDK/JRE, non-root user)
  • AGENTS.md with concise engineering conventions for coding agents

Using This Template

  1. Create a new repository from this template (or clone and re-point origin).
  2. Update <groupId>, <artifactId>, <name>, and <description> in pom.xml, and spring.application.name in src/main/resources/application.yaml.
  3. Rename the root package io.fmalhe.app (and update the package string in CodingRulesTest) to match your service.
  4. Replace or remove the sample module with your own domain modules.

Common Commands

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 .

About

Opinionated Java 25, Spring Boot 4.2, Spring Modulith, Lombok, Checkstyle, ArchUnit, and OpenRewrite Maven starter template

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages