What Is Spring Boot in Java?

Spring Boot is a framework built on top of the Spring ecosystem that lets you create a production-ready Java web application with minimal configuration. It provides embedded servers, sensible defaults, auto-configuration and a starter dependency system β€” you write business logic, not boilerplate.

A complete REST API in 20 lines

@SpringBootApplication
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

@RestController
@RequestMapping("/api/users")
public class UserController {

    @GetMapping("/{id}")
    public User getUser(@PathVariable long id) {
        return new User(id, "Ada Lovelace");
    }

    record User(long id, String name) {}
}

Run ./mvnw spring-boot:run and GET /api/users/1 returns {"id":1,"name":"Ada Lovelace"}. Spring Boot starts an embedded Tomcat, sets up Jackson for JSON serialisation, wires the controller, and handles HTTP routing β€” all from the @SpringBootApplication annotation and the starter dependencies in your pom.xml.

Key concepts

Auto-configuration: Spring Boot detects what is on the classpath and configures beans automatically. Add the JDBC starter? A DataSource bean is configured from your application.properties. Add the security starter? HTTP Basic Auth is applied by default.

Starter dependencies: Starters are curated dependency bundles. spring-boot-starter-web pulls in Spring MVC, embedded Tomcat, Jackson and the logging stack in one line. No version conflicts to manage β€” the Spring Boot BOM manages them.

Embedded server: Your app is a self-contained JAR with Tomcat (or Jetty, Undertow) inside. Deploy with java -jar app.jar β€” no WAR files, no application server to configure separately.

Dependency injection: Spring's IoC container wires your beans (@Service, @Repository, @Component) together automatically. You declare what you need, Spring creates and injects it.

Typical Spring Boot project structure

src/main/java/com/example/
β”œβ”€β”€ App.java                      @SpringBootApplication
β”œβ”€β”€ controller/
β”‚   └── OrderController.java      @RestController
β”œβ”€β”€ service/
β”‚   └── OrderService.java         @Service
└── repository/
    └── OrderRepository.java      @Repository (Spring Data JPA)

Common starters

StarterWhat it adds
spring-boot-starter-webREST APIs, Spring MVC, embedded Tomcat
spring-boot-starter-data-jpaJPA/Hibernate, Spring Data repositories
spring-boot-starter-securityAuthentication, authorisation, CSRF protection
spring-boot-starter-testJUnit 5, Mockito, AssertJ, MockMvc
spring-boot-starter-actuatorHealth checks, metrics, /actuator endpoints

Spring Boot vs plain Spring

Spring Framework (the base) is highly configurable but verbose β€” you manually define beans, configure the dispatcher servlet, set up the transaction manager. Spring Boot is Spring Framework plus opinionated defaults. Most teams use Spring Boot unless they have very unusual configuration requirements.