How do I activate a Spring Boot profile when running from IntelliJ?

前端 未结 13 1667
醉梦人生
醉梦人生 2021-01-30 00:09

I have 5 environments:

 - local (my development machine)
 - dev
 - qc
 - uat
 - live
 - staging

I want different application properties to be u

13条回答
  •  耶瑟儿~
    2021-01-30 00:24

    I added -Dspring.profiles.active=test to VM Options and then re-ran that configuration. It worked perfectly.

    This can be set by

    • Choosing Run | Edit Configurations...
    • Go to the Configuration tab
    • Expand the Environment section to reveal VM options

提交回复
热议问题