Spring Boot

스프링 부트를 구성하는 애노테이션

bloodFinger 2020. 5. 5. 21:20

@SpringBootApplication( with SpringApplication)

- @Configuration, @EnableAutoConfiguration, @ComponentScan 3가지를 하나의 애노테이션으로 합친 것

 

@ComponentScan

-@Component, @Service, @Repository, @Controller, @Configuration이 붙은 클래스 Bean들을 찾아서 Context에 bean등록

@EnableAutoConfiguration

- 스프링 애플리케이션 컨텍스트를 만들 때 자동으로 설정하는 기능 활성화

 

@Configuration

- 구성빈을 사용하겠다

 

@ConditionalOn~~

- ~~조건이 되었을때 활성화를 하겠다.

 

@SpringBootConfigurationProperties

- 스프링과 스프링부트를 구분하기 위해 사용한다.

 

@EnableConfigurationProperties

 -

 

@ConfigurationProperties

-애플리케이션의 속성들을 클래스에 연동하는 동작