maven comman option for spring boot - accgetter/SpringBoot GitHub Wiki

env 設定

-Dspring.profiles.active=xxx

xxxにenvを設定する 例)

mvn -Dspring.profiles.active=development spring-boot:run

こうした場合、application.yml のdevelopmentのスコープが採用される https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html#howto-change-configuration-depending-on-the-environment