Skip to content

Throw exception if spring.config.location uses classpath*: #21168

@vkochnev

Description

@vkochnev

SpringBoot version 2.3.0.M4

When trying to set spring.cloud.bootstrap.location (which is effectively mapped to spring.config.location) to something like classpath*:/config/ discovered that it doesn't work because org.springframework.boot.context.config.ConfigFileApplicationListener internally calls org.springframework.util.ResourceUtils#isUrl with supplied location and when receives false prepends it with file:. As a result it ends up with file:classpath*:/config/ in my case, which is obviously incorrect.
I filed spring-projects/spring-framework#24979 considering it might be a bug in SpringFramework, but was directed that if pattern support is desirable here then org.springframework.core.io.support.ResourcePatternUtils#isUrl should be used instead.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions