Type: New Feature
Affects Version/s: 1.3.7, 2.0-M1
Fix Version/s: None
- Plugins use any config prefix they like which means the user cannot work them out themselves.
- The user cannot tell what config options are available to them without reading all the docs, and it is easy for Plugin authors to forget to document them
- Plugins cannot easily configure other plugins.
- Plugins cannot easily supply default configuration to the application (without merging with or writing to Config.groovy)
- A doWithConfigOptions convention on plugins that uses a DSL to declare the available config options on the plugin, default values for each, custom validators and any other useful metadata.
- Automatic merging of plugin default values defined in the dWCO DSL into main application config if application does not define a value
- Automatic merging of one or more external XXXPluginConfig.groovy files containing only config values for declared plugin options
- A doWithConfig convention on plugins that allows the plugin to change application-wide configuration settings, or plugin-namespaced config options, with access to the existing config object to read existing values
- Support for legacy configuration options in plugins, where the old options supplied by the application are copied into the new plugin-namespaced values so that the plugin reads only the new config values
- Setting of plugin-namespaced config values in implied dependency order, such that plugins can configure other plugins without explicitly having a loadBefore
- Cause accesses to undeclared plugin namespaced config options to fail fast, thus preventing usage of undocumented config by plugin authors.
I've already implemented most of this locally - the parts are not yet implemented.
Implementing this in core would mean that the plugin ecosystem may upgrade to this and then no longer support older grails releases any more.
My suggestion is that this is implemented as a plugin that works with at least the 1.3.x line.