Code Once, Use Everywhere: Building a Shared Module used by Multiple Projects
summary
A real Spring Boot shared module used across five to six production projects is described: a modular layout (core / spring / autoconfigure / starter / test), a BOM for versions, and starters wired to Micrometer + OpenTelemetry bridge. Auto-configurations use optional Maven deps and require constructor parameters (no proxying), metadata is generated via spring-boot-configuration-processor so IDEs show properties, and test utilities (ArchUnit checks, test execution listeners, fail‑fast DI) catch issues early — the setup works and reduced urgent upgrades and vulnerabilities.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 4:21Library structure with Spring Boot
- 13:52Auto configuration and beans
- 18:47Configuration discovery
- 21:17Testing shared modules
- 23:28ArchUnit conventions
- 28:03Documentation best practices
- 31:15Versioning strategy
- 36:11Implementation tips
related talks
45mCode Once, Use Everywhere: Building Shared Libraries for Multiple Projects
56mBuilding a Framework on top of Spring Boot
50mSpring for the architecturally curious developer
50mSpring Modulith – Spring for the Architecturally Curious Developer
46mModular Applications with Spring
50mAnatomy of a Spring Boot App with Clean Architecture
47mWhy your shared libraries are ill - and how to cure them
45mCustomize your Spring Boot experience by writing your own Spring Boot starter
