Closed
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
Type
Projects
Relationships
Development
No branches or pull requests
Activity
spring-projects-issues commentedon Oct 10, 2013
Phil Webb commented
#361
spring-projects-issues commentedon Oct 22, 2013
Phil Webb commented
I am going to mark this one as a duplicate of #13018 since there is so much overlap between them and #13018 has more votes and watchers.