Skip to content

Add "ignoreResourceNotFound" attribute to the @PropertySource [SPR-10932] #15560

Closed
@spring-projects-issues

Description

@spring-projects-issues
Collaborator

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:


Affects: 3.2.4

Issue Links:

1 votes, 4 watchers

Activity

spring-projects-issues

spring-projects-issues commented on Oct 10, 2013

@spring-projects-issues
CollaboratorAuthor

Phil Webb commented

#361

spring-projects-issues

spring-projects-issues commented on Oct 22, 2013

@spring-projects-issues
CollaboratorAuthor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @philwebb@spring-projects-issues

      Issue actions

        Add "ignoreResourceNotFound" attribute to the @PropertySource [SPR-10932] · Issue #15560 · spring-projects/spring-framework