Setting the default active profile in Spring-boot

前端 未结 14 1915
感动是毒
感动是毒 2020-12-13 08:20

I want my default active profile to be production if -Dspring.profiles.active is not set.

I tried the following in my application.pro

14条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 09:06

    What you are doing here is setting the default default profile (the profile that is used on any bean if you don't specify the @Profile annotation) to be production.

    What you actually need to do is set the default active profile, which is done like this:

    spring.profiles.active=production
    

提交回复
热议问题