You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2008/07/22 18:08:27 UTC

[jira] Created: (MNG-3674) originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved

originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved
--------------------------------------------------------------------------------------------------------------------------

                 Key: MNG-3674
                 URL: http://jira.codehaus.org/browse/MNG-3674
             Project: Maven 2
          Issue Type: Bug
          Components: General, Plugins and Lifecycle
    Affects Versions: 2.0.9
            Reporter: John Casey


This is NOT a regression; it's always been this way. Plugin instances are reused when ModelUtils.cloneModel(..) is called, rather than making a copy with the same plugin information. Since the plugin manager modifies that Plugin instance when it resolves a missing version, that modification will be reflected in the originalModel copy that lives in the MavenProject instance. This could be an issue because that originalModel is supposed to be a pristine copy of the POM as it was read - uninterpolated, uninherited, without any profile information injected, and without any modifications by the plugin manager, lifecycle executor, or any other component.

This could affect POM information as it's written out by various plugins during a build, maybe including the POM copy that lands in META-INF of the finished artifact.

The quickest solution to this would be to stop reusing the ModelInheritanceAssembler logic behind the scenes of ModelUtils.cloneModel(..) and instead serialize/deserialize the model instance to/from a StringWriter/Reader. This would leverage the generated formatters and parsers from maven-model to allow us to avoid rewriting that logic for the clone operation.

-- 
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-3674) originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved

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

Brett Porter updated MNG-3674:
------------------------------

    Fix Version/s:     (was: 2.2.1)
                   2.x

> originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3674
>                 URL: http://jira.codehaus.org/browse/MNG-3674
>             Project: Maven 2
>          Issue Type: Bug
>          Components: General, Plugins and Lifecycle
>    Affects Versions: 2.0.9
>            Reporter: John Casey
>             Fix For: 2.x
>
>
> This is NOT a regression; it's always been this way. Plugin instances are reused when ModelUtils.cloneModel(..) is called, rather than making a copy with the same plugin information. Since the plugin manager modifies that Plugin instance when it resolves a missing version, that modification will be reflected in the originalModel copy that lives in the MavenProject instance. This could be an issue because that originalModel is supposed to be a pristine copy of the POM as it was read - uninterpolated, uninherited, without any profile information injected, and without any modifications by the plugin manager, lifecycle executor, or any other component.
> This could affect POM information as it's written out by various plugins during a build, maybe including the POM copy that lands in META-INF of the finished artifact.
> The quickest solution to this would be to stop reusing the ModelInheritanceAssembler logic behind the scenes of ModelUtils.cloneModel(..) and instead serialize/deserialize the model instance to/from a StringWriter/Reader. This would leverage the generated formatters and parsers from maven-model to allow us to avoid rewriting that logic for the clone operation.

-- 
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-3674) originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved

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

John Casey updated MNG-3674:
----------------------------

    Fix Version/s: 2.0.11

> originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3674
>                 URL: http://jira.codehaus.org/browse/MNG-3674
>             Project: Maven 2
>          Issue Type: Bug
>          Components: General, Plugins and Lifecycle
>    Affects Versions: 2.0.9
>            Reporter: John Casey
>             Fix For: 2.0.11
>
>
> This is NOT a regression; it's always been this way. Plugin instances are reused when ModelUtils.cloneModel(..) is called, rather than making a copy with the same plugin information. Since the plugin manager modifies that Plugin instance when it resolves a missing version, that modification will be reflected in the originalModel copy that lives in the MavenProject instance. This could be an issue because that originalModel is supposed to be a pristine copy of the POM as it was read - uninterpolated, uninherited, without any profile information injected, and without any modifications by the plugin manager, lifecycle executor, or any other component.
> This could affect POM information as it's written out by various plugins during a build, maybe including the POM copy that lands in META-INF of the finished artifact.
> The quickest solution to this would be to stop reusing the ModelInheritanceAssembler logic behind the scenes of ModelUtils.cloneModel(..) and instead serialize/deserialize the model instance to/from a StringWriter/Reader. This would leverage the generated formatters and parsers from maven-model to allow us to avoid rewriting that logic for the clone operation.

-- 
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-3674) originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved

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

Jason van Zyl closed MNG-3674.
------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.x)
                   3.x

> originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3674
>                 URL: http://jira.codehaus.org/browse/MNG-3674
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: General, Plugins and Lifecycle
>    Affects Versions: 2.0.9
>            Reporter: John Casey
>             Fix For: 3.x
>
>
> This is NOT a regression; it's always been this way. Plugin instances are reused when ModelUtils.cloneModel(..) is called, rather than making a copy with the same plugin information. Since the plugin manager modifies that Plugin instance when it resolves a missing version, that modification will be reflected in the originalModel copy that lives in the MavenProject instance. This could be an issue because that originalModel is supposed to be a pristine copy of the POM as it was read - uninterpolated, uninherited, without any profile information injected, and without any modifications by the plugin manager, lifecycle executor, or any other component.
> This could affect POM information as it's written out by various plugins during a build, maybe including the POM copy that lands in META-INF of the finished artifact.
> The quickest solution to this would be to stop reusing the ModelInheritanceAssembler logic behind the scenes of ModelUtils.cloneModel(..) and instead serialize/deserialize the model instance to/from a StringWriter/Reader. This would leverage the generated formatters and parsers from maven-model to allow us to avoid rewriting that logic for the clone operation.

-- 
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-3674) originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=204493#action_204493 ] 

Jason van Zyl commented on MNG-3674:
------------------------------------

Fixed in 3.x.

> originalModel in MavenProject has shallow clones of plugin instances and can be polluted when plugin versions are resolved
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3674
>                 URL: http://jira.codehaus.org/browse/MNG-3674
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: General, Plugins and Lifecycle
>    Affects Versions: 2.0.9
>            Reporter: John Casey
>             Fix For: 3.x
>
>
> This is NOT a regression; it's always been this way. Plugin instances are reused when ModelUtils.cloneModel(..) is called, rather than making a copy with the same plugin information. Since the plugin manager modifies that Plugin instance when it resolves a missing version, that modification will be reflected in the originalModel copy that lives in the MavenProject instance. This could be an issue because that originalModel is supposed to be a pristine copy of the POM as it was read - uninterpolated, uninherited, without any profile information injected, and without any modifications by the plugin manager, lifecycle executor, or any other component.
> This could affect POM information as it's written out by various plugins during a build, maybe including the POM copy that lands in META-INF of the finished artifact.
> The quickest solution to this would be to stop reusing the ModelInheritanceAssembler logic behind the scenes of ModelUtils.cloneModel(..) and instead serialize/deserialize the model instance to/from a StringWriter/Reader. This would leverage the generated formatters and parsers from maven-model to allow us to avoid rewriting that logic for the clone operation.

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