Spring Framework
  1. Spring Framework
  2. SPR-8371

Add @PropertySources annotation and support ignoreResourceNotFound

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 3.1 M2
    • Fix Version/s: 4.0 RC1
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      As of 3.1 M2, the @PropertySource annotation allows for declarative registration of property sources against the enclosing Environment. However, it does not allow for manipulation of property source ordering. This (if desired at all) must be done against the ConfigurableEnvironment#getPropertySources() MutablePropertySources API.

      This issue exists to gauge interest in this feature (read: collect votes). Please be specific about use cases in order to assess whether such an enhancement truly represents a general need.

      If interest is sufficient, we'll consider this for 3.1 RC1.

        Issue Links

          Activity

          Hide
          Phil Webb added a comment -

          As of Spring 4.0 you will now be able to repeat @PropertySource annotations when working with Java 8. For Java 6/7 a new @PropertySources annotation has been added.

          Support for ignoreResourceNotFound as suggested by Benjamin Conlan has also been implemented.

          Show
          Phil Webb added a comment - As of Spring 4.0 you will now be able to repeat @PropertySource annotations when working with Java 8. For Java 6/7 a new @PropertySources annotation has been added. Support for ignoreResourceNotFound as suggested by Benjamin Conlan has also been implemented.
          Hide
          David Harkness added a comment -

          The @PropertySources annotation doesn't solve the ordering problem I mentioned above. Since this request has been resolved, should I create a new feature request for ordering separate @PropertySource annotations across multiple @Configuration classes?

          Show
          David Harkness added a comment - The @PropertySources annotation doesn't solve the ordering problem I mentioned above. Since this request has been resolved, should I create a new feature request for ordering separate @PropertySource annotations across multiple @Configuration classes?
          Hide
          Phil Webb added a comment -

          Yes please raise a new issue for that. Thanks.

          Show
          Phil Webb added a comment - Yes please raise a new issue for that. Thanks.
          Hide
          will vuong added a comment -

          Can ignoreResourceNotFound be backported/merged into 3.2.x? This would be nice to have.

          Show
          will vuong added a comment - Can ignoreResourceNotFound be backported/merged into 3.2.x? This would be nice to have.
          Hide
          Phil Webb added a comment -

          will vuong, As a general rule we only back-port bugs not improvements. Spring 4 is almost at RC stage so you shouldn't have too long to wait for this.

          Show
          Phil Webb added a comment - will vuong , As a general rule we only back-port bugs not improvements. Spring 4 is almost at RC stage so you shouldn't have too long to wait for this.

            People

            • Assignee:
              Phil Webb
              Reporter:
              Chris Beams
              Last updater:
              Phil Webb
            • Votes:
              12 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                25 weeks, 6 days ago