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

Add @PropertySources annotation and support ignoreResourceNotFound

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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
          pwebb 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
          pwebb 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
          davidharkness 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
          davidharkness 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
          pwebb Phil Webb added a comment -

          Yes please raise a new issue for that. Thanks.

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

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

          Show
          wvuong will vuong added a comment - Can ignoreResourceNotFound be backported/merged into 3.2.x? This would be nice to have.
          Hide
          pwebb 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
          pwebb 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:
              pwebb Phil Webb
              Reporter:
              cbeams Chris Beams
              Last updater:
              Juergen Hoeller
            • Votes:
              12 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 40 weeks, 3 days ago