java - spring boot external config -
java - spring boot external config -
i trying load external properties file spring boot app. used @propertysource in config class. want remove annotation class not dependent on location. tried use:
java -jar my-boot-ws.war --spring_config_name=file:///users/tmp/resources/
based on http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html documentation next error:
caused by: java.lang.illegalargumentexception: not resolve placeholder
using annotation works fine move away that. help on great
thanks
****** correction *******
sorry re-create paste error above command supposed be:
java -jar my-boot-ws.war --spring.config.location=file:///users/tmp/resources/
i'm not trying alter name of config file add together additional location. explained here:
if spring.config.location contains directories (as opposed files) should end in / (and appended names generated spring.config.name before beingness loaded).
i interpreted saying file ${spring.application.name}.properties loaded --spring.config.location passed in command line
after more googeling found spring boot , multiple external configuration files indicating next right usage:
java -jar my-boot-ws.war --spring.config.location=file:///users/tmp/resources/myfile.properties
i under impression --spring.config.location load other properties files in directory specified. according post @ link mentioned not case. based on link if directory specified application.properties searched for. 1 time again documentation here http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html seems insinuate spring boot app on class path first , if available grab app name additional properties files based on name.
however 1 time specified file name worked fine guess mistaken.
java spring spring-boot
Comments
Post a Comment