Example & Tutorial understanding programming in easy ways.

What is Auto Configuration in Spring?

AutoConfiguration is the most important feature in Spring Boot. Spring Bootauto-configuration attempts to automatically configure your Spring applicationbased on the jar dependencies that you have added

SpringBoot looks configurations at

a)Frameworks available on the CLASSPATH

b)Existing configuration for the application.

Basedon these, Spring Boot provides basic configuration needed to configure theapplication with these frameworks. This is called Auto Configuration.

Youneed to opt-in to auto-configuration by adding the @EnableAutoConfiguration or@SpringBootApplication annotations to one of your @Configuration classes.

You should only ever addone @SpringBootApplicationor @EnableAutoConfigurationannotation. Wegenerally recommend that you add one or the other to your primary @Configurationclass only

Read More →