You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jonathan Pearson (JIRA)" <ji...@codehaus.org> on 2010/09/17 16:27:32 UTC

[jira] Created: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Inheritance Error in Object List Configuration for Custom Plugin
----------------------------------------------------------------

                 Key: MNG-4819
                 URL: http://jira.codehaus.org/browse/MNG-4819
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Inheritance and Interpolation
    Affects Versions: 2.2.1
         Environment: Windows XP SP3, running under Cygwin bash shell
            Reporter: Jonathan Pearson
         Attachments: bugdemo.tgz

When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.

The attached plugin/parent/child projects produce this incorrect output:

$ mvn inherit_bug_demo:bugdemo
...
[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']

The expected output would either be:

[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']

Or:

[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']

See attached build log, demonstration plugin, and parent/child project for details.

Usage:

$ cd inherit_bug_demo
$ mvn deploy
$ cd ../child
$ mvn inherit_bug_demo:bugdemo


-- 
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

        

[jira] Closed: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-4819.
----------------------------------

    Resolution: Duplicate
      Assignee: Benjamin Bentmann

Thanks for the example project!

The default behavior is merging at any depth such that the effective plugin configuration in the child now looks like:
{code:xml}
<configuration>
  <objects>
    <demoObject>
      <prop1>Child Object 1 Property 1</prop1>
      <prop2>Parent Object 1 Property 2</prop2>
    </demoObject>
    <demoObject>
      <prop2>Child Object 2 Property 2</prop2>
      <prop1>Parent Object 2 Property 1</prop1>
    </demoObject>
  </objects>
</configuration>
{code}
i.e. the parent objects get merged to the proper locations in the child list.

To achieve the result that you mention in your last comment, the child POM needs to be changed like this:
{code:xml}
<configuration>
  <objects>
    <demoObject combine.self="override">
      <prop1>Child Object 1 Property 1</prop1>
    </demoObject>

    <demoObject combine.self="override">
      <prop2>Child Object 2 Property 2</prop2>
    </demoObject>
  </objects>
</configuration>
{code}
i.e. the attribute {{combine.self="override"}} disables merging of parent values for that node.

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>            Assignee: Benjamin Bentmann
>         Attachments: bugdemo.tgz, build.log
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Commented: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Jonathan Pearson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235638#action_235638 ] 

Jonathan Pearson commented on MNG-4819:
---------------------------------------

I recommend going with the second of the two output choices (if the child supplies settings for the list, they override the entire parent list and not just those properties that are specified explicitly by the child).

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>         Attachments: bugdemo.tgz, build.log
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Updated: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Jonathan Pearson (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Pearson updated MNG-4819:
----------------------------------

    Attachment: build.log

Also included in bugdemo.tgz, but this may be more convenient.

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>         Attachments: bugdemo.tgz, build.log
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Commented: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Jonathan Pearson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235632#action_235632 ] 

Jonathan Pearson commented on MNG-4819:
---------------------------------------

I'm sorry, I made a mistake in my expected output:

The expected output would either be:

[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 2 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']

The second DemoObject, first property was listed with incorrect "Parent Object 1...", should have been "Parent Object 2..."

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>         Attachments: bugdemo.tgz
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Issue Comment Edited: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Jonathan Pearson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235632#action_235632 ] 

Jonathan Pearson edited comment on MNG-4819 at 9/17/10 9:33 AM:
----------------------------------------------------------------

I'm sorry, I made a mistake in my expected output; the first block should be:

[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 2 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']

The second DemoObject, first property was listed with incorrect "Parent Object 1...", should have been "Parent Object 2..."

      was (Author: celloman):
    I'm sorry, I made a mistake in my expected output:

The expected output would either be:

[INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 2 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']

The second DemoObject, first property was listed with incorrect "Parent Object 1...", should have been "Parent Object 2..."
  
> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>         Attachments: bugdemo.tgz
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Commented: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235666#action_235666 ] 

Benjamin Bentmann commented on MNG-4819:
----------------------------------------

Yes, that attribute can in general be applied on any element within a plugin configuration block.

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>            Assignee: Benjamin Bentmann
>         Attachments: bugdemo.tgz, build.log
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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

        

[jira] Commented: (MNG-4819) Inheritance Error in Object List Configuration for Custom Plugin

Posted by "Jonathan Pearson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235665#action_235665 ] 

Jonathan Pearson commented on MNG-4819:
---------------------------------------

Can that combine.self="override" attribute be used further up the tree? In that example, could it be used on the "objects" element instead of on each individual "demoObject"?

> Inheritance Error in Object List Configuration for Custom Plugin
> ----------------------------------------------------------------
>
>                 Key: MNG-4819
>                 URL: http://jira.codehaus.org/browse/MNG-4819
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Windows XP SP3, running under Cygwin bash shell
>            Reporter: Jonathan Pearson
>            Assignee: Benjamin Bentmann
>         Attachments: bugdemo.tgz, build.log
>
>
> When a parent defines an object list in a plugin configuration, and then a child of that parent also defines an object list for the same plugin leaving some values undefined (so as to use defaults), the object list is loaded into the plugin in an unpredictable manner, sometimes using parent-defined properties instead of defaults, and sometimes not.
> The attached plugin/parent/child projects produce this incorrect output:
> $ mvn inherit_bug_demo:bugdemo
> ...
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2']]']
> The expected output would either be:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Parent Object 1 Property 2'], [DemoObject: prop1='Parent Object 1 Property 1', prop2='Child Object 2 Property 2'], [DemoObject: prop1='Parent Object 3 Property 1', prop2='Parent Object 3 Property 2]]']
> Or:
> [INFO] Configuration: [InheritanceBugDemoMojo: objects='[[DemoObject: prop1='Child Object 1 Property 1', prop2='Property 2'], [DemoObject: prop1='Property 1', prop2='Child Object 2 Property 2']]']
> See attached build log, demonstration plugin, and parent/child project for details.
> Usage:
> $ cd inherit_bug_demo
> $ mvn deploy
> $ cd ../child
> $ mvn inherit_bug_demo:bugdemo

-- 
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