ConfigDataLocationResolver
implementations are loaded using the resource loader's ClassLoader
https://github.com/spring-projects/spring-boot/blob/5e57f1bb7b145db735fb2e6634f52896907db0ce/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironment.java#L157-L161
One of these implementations, StandardConfigDataLocationResolver
, then uses its class's own class loader to load PropertySourceLoader
implementations:
https://github.com/spring-projects/spring-boot/blob/5e57f1bb7b145db735fb2e6634f52896907db0ce/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java#L86-L93
For consistency, it should use the ResourceLoader
that's passed into its constructor instead.