2

I am using spring boot in my application, and I have a properties file for every profile of the application. I also have created a shared property file and included to every profile. it goes like this: application-x.properties application-shared.properties inside the application-x.properties I put this line: spring.profiles.include=shared now if I have this line in x profile: liquibase.enabled=true while in shared profile: liquibase.enabled=false shared profile will override the original profile and I want the exact opposite I have tried solution in this link but it didn't work. Any help?

Community
  • 1
  • 1
Muhammad Bekette
  • 1,396
  • 1
  • 24
  • 60

1 Answers1

0

Instead of using 'application-shared.properties' put the shared properties into 'application.properties'.

Spring will than automatically override properties from 'application.properties' with those of profile specific ones.

See spring-boot external config

  • 1
    That does not work if you have properties you don't want to have set in application.properties (e.g. because it's impossible to unset them) – Bernhard Aug 09 '17 at 07:41