Hi,
(none of this is committed)
Jerome and I have added support for an 'implementation' parameter
to the @parameter tag, so that you can use interfaces as field-types.
The plugin descriptors now have an extra <implementation> tag next to
<type> (which is currently unused, btw).
There's just a little problem in merging that information with the plugin
configuration. There are 2 ways to do this:
1) PluginDescriptorGenerator can add a configuration line for each
parameter that has an implementation attribute. This way the
DefaultPluginManager doesn't have to be modified, since the
mergeTopDown* method automatically picks up these configuration
lines.
Currently configuration lines are only added if a parameter has an
expression or a default-value attribute. This means that the configuration
is only present if it has a value. Adding 'empty' configuration lines
like
<bla/> (this is just an example - my change would result in <bla
implementation="..."/> if there was an implementation
present, otherwise old behaviour)
cause maven to initialize that field, even if it does not appear
in the pom. I suspect the same goes for specifying them in the pom since
the configurations are merged.
So the check whether to initialize a field / mojo property is currently
located in the PluginDescriptorGenerator - which I feel isn't right. If
this were to be fixed then this option would be valid.
2) have DefaultPluginManager merge the parameters <implementation>
tag as an xml attribute, but only if the configuration tag is specified in
either the pom or the mojo descriptor. This is rather straightforward, but
it's a breach of the abstraction currently employed in that code, and
it'll result in ugly code. I feel that it's not good practise add
'special cases' like this in places where they don't belong.
Thoughts on how to best approach this?
-- Kenney
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]