Search
🔫

application config

분야
BE
주제
Spring
심각도
낮음🤒
제보자
담당자
작성자
상태
처리 완료
이슈링크(optional)
작성일자
2023/05/15 11:52
공개여부
비공개
글감

문제 상황

어떤 것을 하려다가 문제가 발생했는가?
1.
application 파일들을 나누어 관리를 하려고 했음
2.
나눈 파일을 하나로 합치는 과정에서 문제가 생김
3.
처음에는 spring.profiles.includes로 합치면 될 것이라고 생각됨
4.
3번 방법으로하니 test할 때 해당 설정이 사라지는 현상이 발생

원인

1.
test할 때 application profiletest로 변경함
2.
이 때 다른 profile설정들이 사라지는 것으로 추정

최종 해결

해결방법
1.
spring.config.import라는 설정이 있음
2.
spring.config.import: classpath:{target-application.yml} 과 같은 방식으로 작성하니 잘 해결됨
spring: config: import: classpath:application-oauth.yml profiles: default: local
YAML
복사

참고자료