We have different config servers per environment. Each spring boot application should target its corresponding config server. I have tried to achieve this by setting profil
Specifying different profiles in a single file is only support for YAML files and doesn't apply to property files. For property files specify an environment specific bootstrap-[profile].properties
to override properties from the default bootstrap.properties
.
So in your case you would get 4 files bootstrap.properties
, bootstrap-prod.properties
, bootstrap-stage.properties
and bootstrap-dev.properties
.
However instead of that you could also only provide the default bootstrap.properties
and when starting the application override the property by passing a -Dspring.cloud.config.uri=
to your application.
java -jar .jar -Dspring.cloud.config.uri=
This will take precedence over the default configured values.