Issue Details (XML | Word | Printable)

Key: MNG-2813
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Unassigned
Reporter: Jochen Kuhnle
Votes: 0
Watchers: 0
Operations

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

OutOfMemoryError when using profiles and pom inheritance

Created: 07/Feb/07 01:34 AM   Updated: 31/May/07 10:12 PM
Component/s: Profiles
Affects Version/s: 2.0.4
Fix Version/s: 3.0-alpha-1

Time Tracking:
Not Specified

File Attachments: 1. Text File MNG-2813-maven-project.patch (3 kB)

Environment: maven-2.0.4

Complexity: Intermediate
Patch Submitted: Yes


 Description  « Hide
When using profiles and POM inheritance, Maven grows out of heap space. This especially happens when using Xpp3Dom's combine.children="append" on plugin configurations in the POMs.

The cause of this is the DefaultProfileInjector in maven-project. It calls Xpp3Dom.mergeXpp3Dom with the profile's configuration as dominant DOM, and the models configuration as recessive DOM to merge the dominant DOM into the recessive one. However, mergeXpp3Dom directly changes the dominant DOM, instead of creating a merged copy. Therefor the profiles DOM is changed. If this profile is injected a second time, e.g. because of a reactor build, the original DOM is gone. Since the changed profile is also saved in the model, this often results in the profile DOM (changed by earlier merge) being merged into itself (saved in model from earlier merge). Boom – we get an OutOfMemoryError.

The attached patch changes DefaultProfileInjector by ensuring that dominant DOMs are copied before they are passed to Xpp3Dom.mergeXpp3Dom.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jason van Zyl added a comment - 31/May/07 10:03 PM
Applying and trying on the trunk.

Jason van Zyl added a comment - 31/May/07 10:12 PM
Patch applied to trunk and branch.