Spring Boot
Spring Boot Auto Configuration
Understand how Spring Boot automatically configures your application.
How Auto Configuration Works
Spring Boot's @EnableAutoConfiguration annotation tells Spring Boot to automatically configure your application based on the JAR dependencies present on the classpath.
For example, if spring-boot-starter-web is on the classpath, Spring Boot automatically configures Tomcat and Spring MVC.
Customizing Auto Configuration
Override defaults in application.properties:
application.properties
# Server Configuration
server.port=8081
# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=secret
# JPA Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true