-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Milestone
Description
Mattias Severson opened SPR-10932 and commented
Currently, a file is required to exist if it is added to the @PropertySource
annotation. If the application already has the properties it needs, it should be possible to launch it without the associated file being present:
@PropertySource(value = {"classpath:/com/example/optional.properties"}, ignoreResourceNotFound = true)
or
@PropertySource(value = {"classpath:/com/example/mandatory.properties", "classpath:/com/example/optional.properties"}, ignoreResourceNotFound = true)
With repeating annotations in Java 8, it should be possible to add the same annotation multiple times:
@PropertySource(value = {"classpath:/com/example/mandatory.properties"})
@PropertySource(value = {"classpath:/com/example/optional.properties"}, ignoreResourceNotFound = true)
Related information:
- The
ignoreResourceNotFound
is supported by the<context:property-placeholder>
for XML-based application contexts. - See comments in issue https://jira.springsource.org/browse/SPR-8371
Affects: 3.2.4
Issue Links:
- Add @PropertySources annotation and support ignoreResourceNotFound [SPR-8371] #13018 Add
@PropertySources
annotation and support ignoreResourceNotFound
1 votes, 4 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement