@SpringBootApplication vs @EnableAutoConfiguration

Pragya Keshap answered on December 17, 2022 Popularity 3/10 Helpfulness 2/10

Contents


More Related Answers

  • Spring Security Configuration
  • springboot security configuration
  • Configure Spring Boot Actuator for development usage
  • appconfig spring
  • Configuring Spring Security 4.2.2
  • spring cloud config server authentication
  • Adding OAuth Client to a Spring Boot project
  • Explain @SpringBootApplication, @Configuration and @ComponentScan annotations
  • Spring Boot - @SpringApplicationConfiguration example
  • Difference between @SpringBootApplication and @ContextConfiguration annotation in Spring Boot?
  • How can you configure Spring Boot application login?
  • Centralized Configurations using Spring Cloud Config Server
  • Some of the autoconfiguration policies baked into Spring Boot
  • How do you externalize configuration using Spring Boot?
  • 2. Setting up the Spring Boot Application

  • @SpringBootApplication vs @EnableAutoConfiguration

    0

    The Spring Boto auto-configuration feature tries to automatically configure your Spring application based upon the JAR dependency you have added in the classpath.

    For example, if HSQLDB is present on your classpath and you have not configured any database manually, Spring will auto-configure an in-memory database for you.

    By default, this auto-configuration feature is not enabled, and you need to opt-in for it by adding the @EnableAutoConfiguration or @SpringBootApplicaiton annotations to one of your @Configuration classes, generally the Main class which is used to run your application.

    Though, this is just the tip of the iceberg. Spring Boot auto-configuration takes more than 200 such decisions to configure your application, If you are interested in learning more about auto-configuration then Learn Spring Boot Rapidly course on Udemy is an excellent course to learn Spring Boot in depth

    Read more: https://www.java67.com/2018/05/difference-between-springbootapplication-vs-EnableAutoConfiguration-annotations-Spring-Boot.html#ixzz7tpumkRTy

    Popularity 3/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Feb 20 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    0
    Popularity 3/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Dec 17 2022
    Deepika Sahu
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.