Property resolving for multiple Spring profiles (yaml configuration)

后端 未结 1 1804
[愿得一人]
[愿得一人] 2020-12-22 04:47

Is there a defined order when multiple profiles are used for a property resolution.

I have yaml configuration file:

         


        
相关标签:
1条回答
  • 2020-12-22 05:30

    Is this something I can rely on?

    Yes, the last-win strategy is consistent and is documented in the reference guide:

    If several profiles are specified, a last-wins strategy applies. For example, if profiles prod,live are specified by the spring.profiles.active property, values in application-prod.properties can be overridden by those in application-live.properties.

    (Unrelated, but about the link to the doc you've shared. I don't know if that's an accident but that's the documentation for Spring Boot 1.2.x which was released over 6 years ago).

    0 讨论(0)
提交回复
热议问题