Spring Boot Best Practices

Chapter 1 of 9 · 4 practices · 3 min · 4-question quiz

Versions, starters and dependencies

Which Spring Boot and Java versions to run, how the modular starters in Spring Boot 4 work, and how to keep dependency versions consistent.

Start: Run a current Spring Boot release on an LTS Java

4 practices in this chapter

  1. 1Run a current Spring Boot release on an LTS JavaSpring Boot 4.1 needs at least Java 17 and is compatible up to Java 26. It builds on Spring Framework 7, Jakarta EE 11 (Servlet 6.1) and Hibernate 7.
  2. 2Depend on the specific Spring Boot 4 starters you useSpring 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.
  3. 3Upgrade to 4.x through the latest 3.5 and the properties migratorThe migration guide's first step is to upgrade to the latest 3.5.x and remove every call to a deprecated API, because those were removed in 4.0. Jumping straight from an older 3.x usually means…
  4. 4Let the Boot BOM manage dependency versionsSpring Boot ships a bill of materials that pins versions of hundreds of libraries known to work together: Jackson, Hibernate, Tomcat, Micrometer, the database drivers and more. Declaring your own…

Check yourself on this chapter

4 questions, right here once you are signed in. Your progress is saved as you read.

Sign up for the quiz