Which of the following annotations enables Auto Configuration in a Spring Boot application?

  • @ComponentScan
  • @Configuration
  • @EnableAutoConfiguration
  • @SpringBootApplication
The @EnableAutoConfiguration annotation enables Auto Configuration in a Spring Boot application. It triggers the automatic configuration of beans and components based on the project's dependencies and classpath. @SpringBootApplication is a meta-annotation that includes @EnableAutoConfiguration along with other annotations. @Configuration is used to define Java-based Spring configurations, and @ComponentScan is used for component scanning. They are not directly related to enabling Auto Configuration.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *