Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Spring profiles group

I decided to deal with the profiles and divide into groups

spring:
//Common settings

---

spring:
  profiles:
    group:
      default:
        - prod
        - actuator
      dev:
        - dev
        - actuatorDev
      uat:
        - uat
        - actuatorUat

Why when I specify dev or uat.
The settings are loaded from the main block, then replaced from dev or uat. And on top is the actuator profile

And when I don’t specify the profile at startup, in theory it’s just default
This kind of magic doesn’t happen

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How to correctly implement general settings and then replace them depending on the default, dev, uat profile?

>Solution :

Please Test:

//...  
spring:
  profiles:
    default: "prod,actuator" # when no profile*S* set [3.]
    group:  # ...according to [3.1] and [3.2]
      dev:
        - "dev"
        - "actuatorDev"
      uat:
        - "uat"
        - "actuatorUat"

Spring (current) Ref: Chap. 3 Profiles

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading