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
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.
-
스프링 부트 외부 설정과 프로필 - 신입 개발자 노트
1. 외부 설정이란?
💡 개념
💬 예시
2. application.properties vs application.yml
3. 외부 설정 우선순위
📌 중요
스프링 부트는 여러 설정 위치를 인식하고 우선순위에 따라 적용함.
우선순위 높은 순서:
--server.port=8081)application.properties/application.yml(src/main/resources)application-{profile}.yml--spring.config.location)4. @value 사용법
🎯 특정 설정 값을 주입받고 싶을 때 사용
${}안에 있는 키를 기반으로 값을 읽어옴5. @ConfigurationProperties 사용법
✅ 여러 설정 값을 객체 단위로 주입할 수 있음
@EnableConfigurationProperties또는@Component필요6. 스프링 프로필
🌱 개념
7. 프로필 적용 방법
방법 1: 설정 파일로 구분
application-dev.yml,application-prod.yml방법 2: 실행 시 지정
방법 3: @Profile 사용
8. 프로필 병합 & 기본 프로필
--spring.profiles.active=dev,debugdefault9. 정리
Beta Was this translation helpful? Give feedback.
All reactions