History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: MNG-2803
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Kamen Petroff
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 2

Inheritance of plugin <configuration> properties

Created: 01/Feb/07 08:00 AM   Updated: 05/Aug/08 10:50 PM
Component/s: Plugin API
Affects Version/s: None
Fix Version/s: Reviewed Pending Version Assignment

Time Tracking:
Not Specified

Complexity: Intermediate


 Description  « Hide
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?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.