본문 바로가기
Spring/boot

@SpringBootApplication 어노테이션이란?

by 무대포 개발자 2020. 10. 18.
728x90
반응형

@SpringBootApplication 어노테이션이란?

  • ComponentScan, SpringBootConfiguration, EnableAutoConfiguration 으로 이루어 짐.
@ComponentScan
  • root 패키지에서 빈검색을 진행한다.
    • @SpringBootApplication 이 선언된 클래스의 패키지를 루트 패키지라 생각하면 됨.
  • @Component, @Bean, @Service 등
@EnableAutoConfiguration
  • 미리 정의되어 있는 빈을 등록해준다.
  • 미리 정의되어 있는 빈은 Spring-boot-autoconfigure 외부 라이브러리에 spring.factoires 에 등록돼있음.
@SpringBootConfiguration
  • SpringBoot 의 @Configuration
  • Configuration 과 동일하다 생각하면 된다.

댓글