How Spring Boot Auto Configuration

Hello everyone, in this article we will see how spring boot auto configurations.

  • • In Spring boot, all the configuration becomes automatic, automatic means that we only have to add the dependency, After that Spring boot will automatically configure as per the dependency.
  • • Earlier we had to do programmatic configuration in spring.
  • • Now Spring boot developers have given all the configuration in writing in Spring boot , we do not have to do programmatic configuration.
  • • Configuration depending up on our dependencies or technologies.
  • • Here all the work is done with pom starter.

Starter POM (Project Object Model)

  • • Spring-boot-starter-web
  • • Spring-boot-starter-data-jpa
  • • Others….

When we add starter jars then it pull all the jars with the help up Maven.



  • • spring.factories file have all Auto-configurations on disable mode.
  • • This Configuration will enable happen under certain conditions.
  • • What should be enabled or disable based on some conditions.
  • • Condition means dependency whenever we add the dependency, that configuration will be enabled at that time.
  • • First it will check the class path and then do the configuration according to the class path.
  • • All configuration classed declare in spring.factories.

In pom.xml file we need to add dependencies


Dependency look like this which is shown in below which is shown in the following figure.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

After adding dependency in pom.xml file maven automatically downloard jar files, which is show in the following figure.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext