티스토리 뷰

발단

윈도우즈 환경에서 VScode IDE를 사용하여 SpringBoot + Gradle 작업을 하던 중
프로젝트 실행 시 profile 별로 동작을 구분하기 위해 yml 파일에 profile을 분리 후
해당 profile로 Run을 하는데 아래와 같은 오류가 발생하였다.

 

PS 프로젝트경로> .\gradlew.bat -Dspring.profiles.active=test bootRun

> Configure project :
profiles 확인 : null

FAILURE: Build failed with an exception.

* What went wrong:
Task '.profiles.active=test' not found in root project '프로젝트 상위 폴더'.

* Try:
> Run gradlew tasks to get a list of available tasks.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

 


원인 및 조치

gradle bootRun 실행 시 profile명 부분이 잘린 부분이 의심되어
인자 값 옵션 부분의 "." 마침표를 제거 후 Run을 하니 정상적으로 동작하였다.


VScode 콘솔창에서는 마침표를 경로로 보는 것으로 보여 인자 값을 "따옴표로 묶어준 후 실행을 해보았다.

아래와 같이 정상적으로 올라간 것을 확인하였다.

 

PS 프로젝트경로> .\gradlew.bat "-Dspring.profiles.active=test" bootRun

> Configure project :
profiles 확인 : test

> Task :bootRun

<==========---> 80% EXECUTING [5s]
> :bootRun

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함