| name | spring-best-practices |
| description | Spring Framework and Spring Boot {version} official reference docs. Use when working on any Java, Kotlin, or Scala project — writing, reviewing, or debugging code; editing build.gradle, pom.xml, application.yml, or application.properties; or when the user mentions Java, Spring, Spring Boot, Spring Cloud, Spring Security, Spring Data, Spring AI, Actuator, Eureka, Feign, auto-configuration, or dependency injection. |
Spring {version} Reference
Official Spring {version} docs, {project_count} projects, generated {generated_at}.
Core Principles
Before writing code, ask: does Spring already do this?
- Auto-configuration backs off. Define your own
@Bean and Boot's disappears.
@ConfigurationProperties for property groups. Typed, validated, IDE-friendly.
- Starters manage versions.
spring-boot-starter-* brings compatible dependencies.
application.yml is the control panel. Most behavior is property-toggleable.
- Actuator is free observability. Health, metrics, tracing — auto-configured.
- Test slices keep tests fast.
@WebMvcTest, @DataJpaTest target one layer.
The Spring Way
| Task | Use |
|---|
| Property groups | @ConfigurationProperties(prefix="...") |
| HTTP clients | Inject RestClient.Builder or WebClient.Builder |
| JSON customization | Jackson2ObjectMapperBuilderCustomizer |
| DataSource setup | spring.datasource.* properties |
| MVC customization | WebMvcConfigurer bean |
| Focused tests | @WebMvcTest, @DataJpaTest, other slices |
| Environment switching | @Profile + spring.profiles.active |
| Health checks | HealthIndicator bean + Actuator /health |
| Security rules | SecurityFilterChain bean |
| Async in WebFlux | Reactive operators |
Reference Index
Open a project's CONTENTS.md, then a section's CONTENTS.md, then load the single topic file you need.
{project_index}