Closed yeollow closed 3 years ago
개발 환경에 따라 설정값을 달리 해야 할 필요가 있을 때, Spring Boot에서는 profile로 취급한다.
application.yml
application-local.yml
application-dev.yml
application-prod.yml
application-{phase}.yml을 다르게 지정함으로써 아래와 같이 gradle을 통한 springBoot실행 시 active profile을 지정할 수 있음. gradle :api:bootRun -Dspring.profiles.active={phase}
gradle :api:bootRun -Dspring.profiles.active={phase}
Spring profile 등록
개발 환경에 따라 설정값을 달리 해야 할 필요가 있을 때, Spring Boot에서는 profile로 취급한다.
application.yml
에는 모든 공통 설정 내용application-local.yml
에는 local환경의 설정 내용application-dev.yml
에는 dev환경의 설정 내용application-prod.yml
에는 prod환경의 설정 내용application-{phase}.yml을 다르게 지정함으로써 아래와 같이 gradle을 통한 springBoot실행 시 active profile을 지정할 수 있음.
gradle :api:bootRun -Dspring.profiles.active={phase}