I have the application.yml
, application-dev.yml
and application-dev.yml
files
- I'm using the maven command
mvn spring-boot:run -Dspring.profiles.active=dev
it doesn't work and I can not choose thedev
profile usingmvn spring-boot:run
. How do I choose it? - The documentation says
java -jar XXX.jar --spring.profiles.active=dev
works, and I tried-Dspring.profiles.active=dev
but it does not work. And in my project, I usejava -jar XXX.jar
it runs, but if I usejava -jar XXX.jar --spring.profiles.active=dev
to choosedev
profile, console print so many logs and warns that I never see usedjava -jar XXX.jar
,and tell meAPPLICATION FAILED TO START
So, how to solve these two problems?
Thanks.