Chapter 1 · Practice 2 of 4
Depend on the specific Spring Boot 4 starters you use
Why it matters
Spring Boot 4 split auto-configuration into modules per technology, each with its own starter: spring-boot-starter-<tech>, plus a test companion spring-boot-starter-<tech>-test.
What changes for you:
spring-boot-starter-webis deprecated in favour ofspring-boot-starter-webmvc.- Technologies that had no starter before, such as Flyway and Liquibase, now need one explicitly.
- Test starters bring
spring-boot-starter-testalong, so you list the technology-specific ones.
Smaller dependency sets mean a smaller classpath, faster startup and fewer surprises from auto-configuration you did not ask for.
Example
dependencies {
implementation("org.springframework.boot:spring-boot-starter-webmvc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-flyway")
implementation("org.springframework.boot:spring-boot-starter-actuator")
testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
}