Understanding Spring Boot autoconfiguration

Spring Boot has a lot of power when it comes to bootstrapping an application and configuring it with exactly the things that are needed, all without much of the glue code that is required of us, the developers. The secret behind this power actually comes from Spring itself, or rather from the Java Configuration functionality that it provides. As we add more starters as dependencies, more and more classes will appear in our classpath. Spring Boot detects the presence or absence of specific classes and based on this information, makes some decisions, which are fairly complicated at times, and automatically creates and wires the necessary beans to the application context.

Sounds simple, right?

In the previous recipes, we added a number of Spring Boot starters such as spring-boot-starter-data-jpa, spring-boot-starter-web, spring-boot-starter-data-test, and so on. We will use the same code that we finished in the previous chapter, in order to see what actually happens during the application startup and the decisions that Spring Boot will make while wiring our application together.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.70.93