Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-10325

Allow for ignoreResourceNotFound on @PropertySource


    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.2.1
    • Fix Version/s: 4.0 GA
    • Component/s: Core:Environment
    • Labels:
    • Last commented by a User:


      It doesn't appear to be possible to set up @PropertySource annotations that refer to non-existent files.

      It can be quite useful to allow for optional configuration files, for example, ~/.application/application.properties to allow for the optional overriding of configuration properties on a per user basis. I might not have the file, but if I do, it's values should override the defaults.

      It is possible to achieve this behaviour with 'setIgnoreResourceNotFound' on the PropertyPlaceholderConfigurer, but the new @PropertySource annotation will throw a FileNotFoudException and the application context fails to start.

      Consider adding an attribute to @PropertySource to allow for this behaviour, and potentially a @PropertySources annotation which can be configured with an array of @PropertySource values to allow for file configuration on a per file basis.

        Issue Links


          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          532d 23h 48m 1 Juergen Hoeller 09/Aug/14 9:53 AM


            • Assignee:
              juergen.hoeller Juergen Hoeller
              wesleyhall Wesley Hall
              Last updater:
              Juergen Hoeller
            • Votes:
              11 Vote for this issue
              10 Start watching this issue


              • Created:
                Days since last comment:
                4 years, 44 weeks, 3 days ago