The thing is that a standalone JSR should also work in a EE context. This also a precondition, when we want to have a chance that also further EE JSRs would support such a configuration JSR in the future, thus enabling cloud configuration for the whole EE stack. And when you go into EE, you will have some additional complexities, that are not coverable using system properties. System (and environment) properties work well, for global settings (e.g. on VM/domain level), but because of their global characteristics are not feasible on ear or war level.
In general I think we require the possibility to read configuration from arbitrary sources. Different vendors (or companies) have different ways to define/distribute/consume configuration and there will not be any common consense, what is the best way to go here. As an example:
- one wants to provide configuration as local files, or access it as a loadable jar file from a maven repository.
- others may want to use a database for storing the configuration.
- others may have rest/SOAP services defined in their SOA layers.
- other even do a combination of all
- others may use a distributed data grid like Hazelcast
- ... (the possibilities are endless)
Additionally there are also the topics of configuration defaults and overriding of configuration. In this context application code (ears, wars, or even smaller units like products and modules) may ship out of the box with according default values, that may be overridden by the concrete (deployment specific) configuration, or by more detailed/finer grained layers. This use cases also have similar complexities, since any thinkable combination of applications, products, features etc. will be possible. When thinking on framework design additional layers to domain/ear/war would be required, that such a JSR should support, too.
Summarizing configuration for me is not a unidimensional collection of system properties or values. I personally see it as an ordered collection of unidirectional graphs (or trees?), where the ordering defines the overriding relationships, We may discuss how far we want to go in enabling the possibilities of overriding mechanisms, such as combination, replacement, exclusion etc.
The good thing is, that all the complexities so far mentioned can be modelled by only a few powerful and simple concepts:
Final Value (any type), ConfigEntry, ConfigUnit, Scopes, Configuration(aggregate), ConfigurationService
CDI, I agree is just on top of it, as a glue layer. We should be careful to not rebuild CDI once more ;-)