The Spring Boot configuration
In this section, the focus will be on the configuration aspects of Spring Boot. The chapter2.bootrest
project, already developed, will be modified in this section to showcase configuration capabilities. Copy and paste chapter2.bootrest
and rename the project as chapter2.boot-advanced
.
Understanding the Spring Boot autoconfiguration
Spring Boot uses convention over configuration by scanning the dependent libraries available in the class path. For each spring-boot-starter-*
dependency in the POM file, Spring Boot executes a default AutoConfiguration
class. AutoConfiguration
classes use the *AutoConfiguration
lexical pattern, where *
represents the library. For example, the autoconfiguration of JPA repositories is done through JpaRepositoriesAutoConfiguration
.
Run the application with --debug
to see the autoconfiguration report. The following command shows the autoconfiguration report for the chapter2.boot-advanced
project:
$java -jar target/bootadvanced-0.0.1-SNAPSHOT...