You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spring-boot-autoconfigure 모듈 내부의 META-INF/spring.factories 또는 META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 파일에서 자동 구성 클래스 목록을 정의함
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1. 자동 구성이란?
1-1. 개념
@EnableAutoConfiguration또는@SpringBootApplication에 포함되어 있음1-2. 왜 필요한가?
2. 자동 구성의 동작 방식
2-1. @SpringBootApplication의 구성
@EnableAutoConfiguration덕분에 다양한 설정이 자동으로 적용됨2-2. 자동 구성이 동작하는 방식
spring-boot-autoconfigure모듈 내부의META-INF/spring.factories또는META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports파일에서 자동 구성 클래스 목록을 정의함3. 조건부 자동 설정
3-1. 대표적인 조건 어노테이션
@ConditionalOnClass@ConditionalOnMissingBean@ConditionalOnProperty@ConditionalOnBean3-2. 예시 코드
4. 자동 구성 클래스 예시: SecurityAutoConfiguration
4-1. spring-boot-autoconfigure 내부 구성 예시
4-2. 해석
@AutoConfiguration: 자동 구성 클래스임을 명시@ConditionalOnClass: 특정 클래스가 있을 경우에만 활성화@Import: 실질적인 설정 클래스 로드5. 사용자 정의 자동 구성
5-1. 직접 자동 구성 만들기
@Configuration또는@AutoConfiguration사용spring.factories또는AutoConfiguration.imports에 클래스 등록5-2. 실습 예시
6. 자동 구성 비활성화
6-1. 특정 자동 구성 제외
6-2. application.yml에서 설정 비활성화
7. 정리
Beta Was this translation helpful? Give feedback.
All reactions