Sobes.tech
Junior — Middle

Can you name the annotations used in Spring Boot Starter for configuration and auto-configuration of components?

sobes.tech AI

Answer from AI

The following annotations are often used in the Spring Boot Starter for configuration and automatic component setup:

  • @SpringBootApplication — combines @Configuration, @EnableAutoConfiguration, and @ComponentScan. This is the main annotation for running a Spring Boot application.
  • @EnableAutoConfiguration — enables Spring Boot's auto-configuration, which attempts to configure the application based on dependencies in the classpath.
  • @Configuration — indicates that the class contains bean definitions.
  • @ComponentScan — instructs Spring to scan specified packages for components, services, and controllers.

Example:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
Can you name the annotations used in Spring Boot… - sobes.tech