[
https://jira.codehaus.org/browse/MNG-3674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Osipov updated MNG-3674:
--------------------------------
Fix Version/s: 3.0
> originalModel in MavenProject has shallow clones of plugin instances and can
> be polluted when plugin versions are resolved
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: MNG-3674
> URL: https://jira.codehaus.org/browse/MNG-3674
> Project: Maven
> Issue Type: Bug
> Components: General, Plugins and Lifecycle
> Affects Versions: 2.0.9
> Reporter: John Casey
> Fix For: 3.0
>
>
> 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 was sent by Atlassian JIRA
(v6.1.6#6162)