Issue #19909 has introduced a PathMatchingResourcePatternResolver
to ConfigFileApplicationListener
to support wildcard imports. We should consider if we still want to do this after we look at #19990.
We also need to address https://github.com/spring-projects/spring-boot/issues/21168#issuecomment-620528456
Comment From: vkochnev
@philwebb, I can see that the team decided to restrict wildcards in spring.config.location
. Have you discussed how my "shared configuration" case can be addressed?
Comment From: philwebb
@vkochnev I think I'd recommend looking into using the EnvironmentPostProcessor
interface to add a property source that contains the values you need. The ConfigFileApplicationListener
is really designed to pick up user configuration, I think it might be problematic to try and have it also pickup properties contributed by starters.
Other than the additional complexity, the main reason we didn't want to add classpath:*
to the ConfigFileApplicationListener
is ordering the files are processed is hard to determine. If two jars happen to provide application.properties
files with the same value, it will be very difficult to know which will win. That might not be a problem in your situation, but we've found those ordering issues to be very problematic for users and a common source of bugs.
Comment From: philwebb
Reopening to address https://github.com/spring-projects/spring-boot/commit/8ec16bd027dd222863d92f022c0350c99edae027#commitcomment-38955589
Comment From: vkochnev
@philwebb thanks, I'll look into it. I understand the importance of ordering.
Comment From: mbhave
@philwebb I think we should create a new issue for https://github.com/spring-projects/spring-boot/issues/21217#issuecomment-624175557 since this one has already gone into RC1.
Comment From: philwebb
@mbhave Whoops, I missed that. I guess it's basically a polishing commit so I'll leave it on this issue.