Inheritance of plugin <configuration> properties
------------------------------------------------
Key: MNG-2803
URL: http://jira.codehaus.org/browse/MNG-2803
Project: Maven 2
Issue Type: Improvement
Components: Plugin API
Reporter: Kamen Petroff
It would be beneficial, if some plugin configuration properties (of list, map
or array type, not simple types) could be extended from the parent POM by
inheritance.
Currently the value specified in the child configuration overwrites the value
specified by the parent POM. This is OK for simple properties. For collection
properties however, it would be nice, if the collection specified by the parent
is extended with the entries specified by the child configuration.
As an illustration imagine a parent POM defining a plugin configuration:
------------------
....
<configuration>
<imports>
<import>com.company.package1</import>
<import>com.company.package2</import>
</imports>
</configuration>
....
------------------
It would be nice if a child POM could *add* to the <imports> from the parent
another <import> like this:
------------------
....
<configuration>
<imports>
<import>com.company.package3</import>
</imports>
</configuration>
....
------------------
This is however not possible, as the <imports> property in the child
configuration overwrites the one specified in the parent's configuration. This
forces the child POM to specify all three <imports> entries in its plugin
configuration.
It should be somehow possible to specify on a per property basis, if the
parent's collection property is to be extended or overwritten.
I tried to implement this "collection property inheritance" in my plugin, by
iterating down the parent MavenProjects and accessing their Xpp3Dom
configuration directly. This works fine. However when the LifeCycle is forked
(by the clover plugin for example), project.getParent() returns null.
Does someone have an idea how to access the Parent's POM plugin configuration?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira