I try to start a simple Spring Boot application (APP) which use a library dependency (LIB).
LIB provide commons configuration with application.yml in root classpath. APP provide specific configuration through its own application.yml also in root classpath.
When the APP started, Spring Boot complains that it can't find some properties (those from LIB). If I move the LIB application.yml under config/ in class path, everything goes fine.
config/
Reading the documentation (https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-files), it is not clear why every classpath:/application.yml aren't loaded. Is it expected behavior ?
Yes, this is the expected behaviour. When loading from the classpath, the first application.yml file that is found will win and any other files with the same name on the classpath will be ignored.
application.yml
1.4m articles
1.4m replys
5 comments
57.0k users