From toby-essentials
Guides Spring Boot 4 and Spring Framework 7 development, migration from Boot 3 to 4, and resolution of breaking changes like starter POM renames, Jackson 3, and Jakarta EE 11.
npx claudepluginhub tobyilee/toby-plugins --plugin toby-essentialsThis skill uses the workspace's default tool permissions.
Spring Boot 4 (November 2025) is built on Spring Framework 7 and introduces significant structural changes. This skill provides the essential knowledge for developing with or migrating to Boot 4.
Provides knowledge patch for Spring Boot 4.0 changes: modular starters, Jackson 3, Framework 7, Security 7, Spring AI 1.0, HTTP clients. Use before recent Spring Boot tasks.
Migrates Spring Boot apps to version 4 with Java 25 via phased upgrades, including Spring Modulith 2, Testcontainers 2, codebase scanning, and reference guides.
Verifies Spring Boot 4.x projects for dependency compatibility, configuration correctness, and migration readiness. Analyzes pom.xml, build.gradle, and application.yml files.
Share bugs, ideas, or general feedback.
Spring Boot 4 (November 2025) is built on Spring Framework 7 and introduces significant structural changes. This skill provides the essential knowledge for developing with or migrating to Boot 4.
| Dependency | Minimum | Recommended |
|---|---|---|
| Java | 17 | 25 (LTS) |
| Jakarta EE | 11 | — |
| Servlet | 6.1 (Tomcat 11+, Jetty 12.1+) | — |
| JPA | 3.2 (Hibernate 7.1/7.2) | — |
| Jackson | 3.x (2.x deprecated) | — |
| Kotlin | 2.2+ | — |
| GraalVM | 25+ | — |
| JUnit | 6 (JUnit 4 deprecated) | — |
These are the changes most likely to cause immediate build or runtime failures.
Boot 4's biggest structural change: the monolithic spring-boot-autoconfigure has been split into technology-specific modules. Starter POMs are renamed and restructured.
Immediate impact:
<!-- BEFORE (Boot 3) -->
<artifactId>spring-boot-starter-web</artifactId>
<!-- AFTER (Boot 4) -->
<artifactId>spring-boot-starter-webmvc</artifactId>
Key renames:
| Boot 3 | Boot 4 |
|---|---|
spring-boot-starter-web | spring-boot-starter-webmvc |
spring-boot-starter-aop | spring-boot-starter-aspectj |
spring-boot-starter-oauth2-client | spring-boot-starter-security-oauth2-client |
spring-boot-starter-oauth2-resource-server | spring-boot-starter-security-oauth2-resource-server |
Technologies that previously only needed a 3rd-party dependency (e.g., Flyway, Liquibase) now require a dedicated starter:
spring-boot-starter-flywayspring-boot-starter-liquibaseTest starters are also separated: spring-boot-starter-<tech>-test. For example, @WithMockUser requires spring-boot-starter-security-test.
Quick migration path: Use spring-boot-starter-classic / spring-boot-starter-test-classic temporarily, then migrate incrementally.
For the full starter mapping table, see references/modularization.md.
Boot 4 defaults to Jackson 3. The package name changed from com.fasterxml.jackson to tools.jackson (except annotations which stay in com.fasterxml.jackson.annotation).
Key changes:
Jackson2ObjectMapperBuilder removed → use JsonMapper.builder()@JsonComponent → @JacksonComponent@JsonMixin → @JacksonMixinspring.jackson.read.* → spring.jackson.json.read.*For Jackson 2 compatibility during migration, add spring-boot-jackson2 module and use spring.jackson.use-jackson2-defaults=true.
For detailed migration steps, see references/jackson3-migration.md.
javax.* completely removedjavax.annotation and javax.inject annotations are no longer supported. All code must use jakarta.annotation / jakarta.inject equivalents. This is not new from Jakarta EE 9 migration, but Spring 7 removes any remaining fallback support.
HttpHeaders no longer extends MultiValueMapThis is a subtle but widespread breaking change. Code that treats HttpHeaders as a MultiValueMap will fail. Use HttpHeaders#asMultiValueMap() as a temporary bridge (itself deprecated).
Spring's own @Nullable / @NonNull annotations (org.springframework.lang) are deprecated in favor of JSpecify (org.jspecify.annotations). Kotlin projects may see compilation errors from changed nullability.
Undertow doesn't support Servlet 6.1 yet. Use Tomcat 11+ or Jetty 12.1+.
RestTemplate is officially deprecated. Use RestClient (introduced in 6.1) for imperative HTTP calls.
Spring MVC and WebFlux now support API versioning natively:
@GetMapping("/users")
@ApiVersion("1")
public List<UserV1> getUsersV1() { ... }
@GetMapping("/users")
@ApiVersion("2")
public List<UserV2> getUsersV2() { ... }
Configurable version resolution (header, path, query param), deprecation marking, and client-side support in RestClient/WebClient.
Spring Retry has been absorbed into Spring Framework core:
@EnableResilientMethods
@Configuration
public class AppConfig { }
@Retryable(maxAttempts = 3)
public String callApi() { ... }
@ConcurrencyLimit(limit = 10)
public String heavy() { ... }
Works with reactive methods too (auto-adapts to Reactor retry).
RestTestClient — Non-reactive test clientThe community-requested replacement for WebTestClient that doesn't require reactive dependencies:
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureRestTestClient
class MyTest {
@Autowired
RestTestClient restTestClient;
}
New BeanRegistrar contract for flexible, multi-bean registration beyond @Bean methods:
public class MyRegistrar implements BeanRegistrar {
@Override
public void register(BeanRegistry registry, Environment env) {
registry.registerBean("myService", MyService.class);
}
}
@ImportHttpServices — Simplified HTTP client config@Configuration
@ImportHttpServices(group = "weather", types = {WeatherApi.class})
static class Config extends AbstractHttpServiceRegistrar { }
JmsClientFluent JMS client following the JdbcClient/RestClient pattern.
EntityManager / EntityManagerFactory directly injectable via @AutowiredStatelessSession DI supportPersistenceConfiguration for XML-free JPA setupFor comprehensive feature details, see references/new-features.md.
These changes will affect almost every test class:
| Change | Action Required |
|---|---|
@SpringBootTest no longer auto-configures MockMVC | Add @AutoConfigureMockMvc |
@SpringBootTest no longer provides TestRestTemplate | Add @AutoConfigureTestRestTemplate |
@MockBean / @SpyBean | Deprecated → use @MockitoBean / @MockitoSpyBean |
| JUnit 4 support | Deprecated → use JUnit Jupiter SpringExtension |
@Mock / @Captor fields | Require MockitoExtension from Mockito directly |
For full testing migration details, see references/testing-changes.md.
spring-boot-starter-classic for quick compatibilityjavax.* → jakarta.* if any remainspring-boot-jackson2 temporarily)@AutoConfigureMockMvc, @MockitoBean, etc.)spring-boot-starter-classic with individual technology startersRestTemplate with RestClientSome commonly used properties have been renamed:
| Boot 3 | Boot 4 |
|---|---|
spring.data.mongodb.* (some) | spring.mongodb.* |
spring.session.redis.* | spring.session.data.redis.* |
spring.jackson.read.* | spring.jackson.json.read.* |
spring.jackson.write.* | spring.jackson.json.write.* |
spring.dao.exceptiontranslation.enabled | spring.persistence.exceptiontranslation.enabled |
| Boot 3 | Boot 4 |
|---|---|
org.springframework.boot.env.EnvironmentPostProcessor | org.springframework.boot.EnvironmentPostProcessor |
org.springframework.boot.BootstrapRegistry | org.springframework.boot.bootstrap.BootstrapRegistry |
org.springframework.boot.autoconfigure.orm.jpa.EntityScan (concept) | org.springframework.boot.persistence.autoconfigure.EntityScan |
org.springframework.boot.test.autoconfigure.properties.PropertyMapping | org.springframework.boot.test.context.PropertyMapping |
references/modularization.md — Full starter/module mapping tables and migration strategyreferences/jackson3-migration.md — Jackson 2→3 detailed migration guidereferences/new-features.md — All new features with examplesreferences/testing-changes.md — Test code migration details