Junior — Middle
What functionality is combined in the @SpringBootApplication annotation in Spring Boot?
sobes.tech AI
Answer from AI
The @SpringBootApplication annotation in Spring Boot combines three key annotations:
@SpringBootConfiguration— indicates that the class is a configuration class and contains bean definitions.@EnableAutoConfiguration— enables Spring Boot's auto-configuration, which attempts to automatically configure the application based on dependencies in the classpath.@ComponentScan— enables component scanning in the current package and its sub-packages, allowing automatic detection and registration of beans.
Thus, @SpringBootApplication simplifies application setup by combining these three aspects into a single annotation.