Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring cloud - bootstrap.properties outside my jar

I am trying to put bootstrap.properties from outside my jar, so it won't get overridden by other developers by mistake. Could you please advice here?

This is its' content - directing to the spring server config

# application name
spring.application.name=elixium
# The server entry point
spring.cloud.config.uri=http://localhost:8888
like image 880
Amir Botvinik Nadiv Avatar asked Apr 21 '16 07:04

Amir Botvinik Nadiv


1 Answers

Spring Cloud uses the the same locations as spring boot to find bootstrap.properties (or .yml). So classpath:,classpath:/config,file:,file:config/ is the default search path, ./config/ is the highest precedence. If your file is in ./config or ./ it should just work. The property (spring.cloud.bootstrap.location) to change the location is slightly different than boot.

like image 188
spencergibb Avatar answered Oct 05 '22 22:10

spencergibb