티스토리 뷰
728x90
@SpringBootApplication
- 스프링 부트의 시작점
- @SpringBootConfiguration, @EnableAutoConfiguration 및 @ComponentScan을 포함한다.
@ComponentScan
- @Component. @Configuration, @Repository, @Controller, @Service, @RestController
- 위의 어노테이션을 가진 클래스를 빈으로 등록해준다.
@EnableAutoConfiguration
- 미리 정의되어있는 빈들 가져와서 등록한다.
public @interface EnableAutoConfiguration {
String ENABLED_OVERRIDE_PROPERTY = "spring.boot.enableautoconfiguration";
/**
* Exclude specific auto-configuration classes such that they will never be applied.
* @return the classes to exclude
*/
Class<?>[] exclude() default {};
/**
* Exclude specific auto-configuration class names such that they will never be
* applied.
* @return the class names to exclude
* @since 1.3.0
*/
String[] excludeName() default {};
}
- spring.boot.enableautoconfiguration 패키지의 META-INF -> spring.factories에 등록된 bean들을 등록한다.
@SpringBootConfiguration
- @Bean정의 메서드를 가지고 있다는 의미를 가짐
- @Configuration의 대체로 구성을 자동으로 찾을수 있음(테스트시에 유용)
- 출처 - https://www.baeldung.com/springbootconfiguration-annotation
SpringBootConfiguration (Spring Boot Docs 2.1.7.RELEASE API)
Indicates that a class provides Spring Boot application @Configuration. Can be used as an alternative to the Spring's standard @Configuration annotation so that configuration can be found automatically (for example in tests). Application should only ever i
docs.spring.io
https://jhleed.tistory.com/126
Spring Boot의 Config Annotation 에 대해 알아보자
스프링을 써본 개발자라면, Spring 환경설정을 하다 진이 빠진 경험이 한 두번 쯤은 있을 것이다. 스프링 부트는 어떻게 이러한 설정이 없이 동작이 가능한 것일까? 스프링 부트는 여러 자주 사용되는 설정들이 기..
jhleed.tistory.com
https://betterfly88.github.io/dev/spring_1/
[Spring Boot]@SpringBootApplication
본문 내용은 인프런에서 제공하는 백기선님의 스프링부트 개념과 활용 강의 내용을 정리한 글입니다.
betterfly88.github.io
728x90
'프레임워크 > 스프링 & 스프링 부트' 카테고리의 다른 글
Spring Boot Admin (1) | 2019.12.30 |
---|---|
Spring boot actuator (0) | 2019.12.30 |
Spring Boot - ORM(Object-relational mapping) (0) | 2019.08.10 |
Spring Boot - MVC (0) | 2019.08.10 |
Spring Boot? (0) | 2019.08.10 |
댓글