Auto-configuration, starters, embedded server — what makes Spring Boot fast to use.
Published February 1, 2025
Spring Boot is an opinionated framework that makes it easy to create stand-alone, production-grade Spring applications with minimal configuration.
1. Auto-configuration
Spring Boot looks at your classpath and configures beans automatically. Add spring-boot-starter-data-mongodb and a MongoTemplate bean appears — no XML, no @Bean definition needed.
2. Starters
Curated dependency bundles. spring-boot-starter-web pulls in Tomcat, Jackson, Spring MVC, and the wiring between them in one line.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
3. Embedded server
No WAR deployment. Your app is a JAR with an embedded Tomcat/Jetty:
java -jar myapp.jar
# Server started on port 8080 in 1.2s
@SpringBootApplication
public class MyApp {
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
}
@RestController
class HelloController {
@GetMapping("/hello")
public String hello() {
return "Hello, World!";
}
}
# application.yml — more readable for nested configs
spring:
data:
mongodb:
uri: mongodb://localhost:27017/mydb
server:
port: 8080
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Adds endpoints: /actuator/health, /actuator/metrics, /actuator/info.
Interviewers ask: "What happens when you annotate a class with @SpringBootApplication?"
It's a shorthand for @Configuration + @EnableAutoConfiguration + @ComponentScan. Auto-configuration reads META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports and wires up everything it finds on the classpath.