서버/spring
InvalidConfigDataPropertyException 에러 해결방법
아카이sun
2022. 2. 28. 17:20
인텔리제이에서 active profile을 설정하고 실행하면 다음과 같은 에러가 발생하는 경우가 있다.
아래의 에러는 profile을 dev로 설정하여 실행한 케이스이다.
Property 'spring.profiles.active' imported from location 'class path resource [application-dev.properties]' is invalid in a profile specific resource [origin: class path resource [application-dev.properties] - 1:24]
string.profiles.active 를 dev로 설정하고 실행한 경우로서 해결방법은 아주 간단하다.
application.properties에 다음의 옵션을 추가하면 된다.
나의 경우에는 dev모드를 따로 설정하고 있으므로 application-dev.properties에 추가하였다.
spring.config.use-legacy-processing=true
테스트 해보니 모드에 따라서 잘 실행된다.