-1

I'm a newcamer in Spring Boot. And I feel like I have some configuration issue.

I want to create file business-config.yml with data for business validation. But Spring does not see this file, wherever I put it. And there's no any exception or error. The application successfully reads the files application.yml and bootstrap.yml and I see all the values from them in the actuator. But there're no values from any new files business-config.yml in the actuator. How can I point it correctly to set it properly? enter image description here

And why do these files application.yml and bootstrap.yml have such green icons in the form of a spring icon? How can this be setted? Where do you need to specify and register these files?

Michael
  • 1,152
  • 6
  • 19
  • 36

1 Answers1

0

You need to tell Spring that it must also check for other files in addition to the defaults. You can do this with the following property:

spring.config.additional-location = classpath:/business-config.yml

or spring.config.import if you are using Spring Boot 2.4 or above:

spring.config.import = business-config.yml

Regarding "And why do these files application.yml and bootstrap.yml have such green icons in the form of a spring icon?" the answer is that those are the standard Spring-Boot configuration files that IntelliJ is able to identify as Spring related and thus the icon.

João Dias
  • 16,277
  • 6
  • 33
  • 45