@PropertySource ignoreResourceNotFound throws exception for unresolved placeholder values [SPR-11524] #16149
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Mattias Severson opened SPR-11524 and commented
Proposal: Spring should silently ignore any unresolved placeholders used in
@PropertySource
if theignoreResourceNotFound
attribute has been set totrue
.Consider the following Java config:
The application fetches default properties from
default.properties
, but it is also possible to override properties by specifying theUNKNOWN_PATH
environmental variable to point to a folder that containsoptional.properties
.Since the
ignoreResourceNotFound
attribute has been set totrue
, the optional properties file does not need to be present for the application to start (and this works). However, if theUNKNOWN_PATH
is not specified (neither as a system property, nor as an environmental variable), an exception is currently thrown:Preferably, Spring should silently ignore that the placeholder cannot be resolved in this case.
Affects: 4.0.2
The text was updated successfully, but these errors were encountered: