728x90
org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-dev.yml]' is invalid in a profile specific resource [origin: class path resource [application-dev.yml]
와 같은 오류는!!
스프링 부트 2.4 이전에는 profiles 에 구분자를 추가하고 applicatioin.yml 등의 default profiles 에 "-" 로 구분 되는 yml 파일로 사용이 가능했다
예) applicatioin-dev.yml
하지만 2.4 이후 부터는 더 이상 허용 되지 않는다!
그럼 어떻게 해야하는가?
아래와 같이 하면 해결!
spring:
config:
activate:
on-profile: dev
profiles active 대신 config.activate.on-profile을 쓰는 것이다
docker file 은 동일하게 사용이 가능하다.
ARG ENV
ENV SPRING_PROFILES_ACTIVE=${ENV}
실행은
docker build --build-arg env=dev -t servername .
을 사용하면 된다.
728x90
'Kotlin Spring' 카테고리의 다른 글
DataFetchingEnvironment 세팅하는 방법 (0) | 2024.12.11 |
---|---|
Webflux 는 어디서 동작하나? (0) | 2024.12.10 |
Kotlin Spring Boot docker file 빌드 배포 (0) | 2024.12.05 |
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref : "/settings.gradle.kts": not found (0) | 2024.12.05 |
코루틴에 대해서 ( about " Coroutine ") (0) | 2024.12.03 |