Setting active profile and config location from command line in spring boot

后端 未结 11 1622
借酒劲吻你
借酒劲吻你 2020-11-27 09:33

I have a spring boot application.

I have three profiles in my application-> development, staging and production. So I have 3 files

  1. ap
11条回答
  •  悲&欢浪女
    2020-11-27 10:32

    There's another way by setting the OS variable, SPRING_PROFILES_ACTIVE.

    for eg :

    SPRING_PROFILES_ACTIVE=dev gradle clean bootRun
    

    Reference : How to set active Spring profiles

提交回复
热议问题