0

I am trying override few of the properties in my spring boot application. The properties are spread across mutiple yml files within the same directory and hence i would like to specify spring.config.additional-location parameter with the value of directory..

spring.config.additional-location=file:///Mydirectory/

But the application is not able to load the configs. If I explicitly specify the file name, the properties are getting overwritten

spring.config.additional-location=file:///Mydirectory/application.yml

Is it possible to load all the files available in a directory using spring.config.additional-location? If yes, please let me know

  • multiple yml files? what are those names? by default spring will check only for `application.yml` file in any location – Ryuzaki L May 21 '19 at 02:37
  • We have multiple modules and the file names will be application-{module}.yml – tech techie May 21 '19 at 02:43
  • then you need to specify them, sow an example or code will try to suggest best approach – Ryuzaki L May 21 '19 at 02:44
  • Oh.. When passing the config location i should explicitly mention the module name also is it? – tech techie May 21 '19 at 03:01
  • mvn clean test -P{project} -Dspring.config.additional-location='/Desktop/myconfigs/‘ The files in myconfigs are: application-module1.yml application-module2.yml application-module3.yml – tech techie May 21 '19 at 03:21

0 Answers0