Search code examples
javaspring-bootspring-cloudproperties-filespring-cloud-config

Common properties for all profile of one service: spring cloud config


I would like to setup common properties across all profile for one single service. How it can be done? For now I have following structure

application.properies
service1
   profile1
       service1.properties
   profile2
       service1.properties
service2
   profile1
       service2.properties
   profile2
       service2.properties

How can I share common properties for all profiles of service1?


Solution

  • You can define these properties in bootstrap.yml or bootstrap.properties file:

    application:
        name: "service1"
    
    cloud:
        config:
          uri: "http://<hostname>:<port>"
    
    # ... more common properties