Issue Details (XML | Word | Printable)

Key: MPH-40
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Siveton
Reporter: Jürgen Hermann
Votes: 0
Watchers: 0
Operations

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

help:effective-pom emits invalid XML to output file

Created: 18/Apr/08 03:46 AM   Updated: 23/Aug/08 03:55 PM   Resolved: 23/Aug/08 03:55 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1

Time Tracking:
Not Specified

Issue Links:
Duplicate
 


 Description  « Hide

Currently, this fragile post-processing is needed to make the content in a file generated with -Doutput=... parseable:

<move overwrite="true" file="${deploy.effective.pom.xml.file}.tmp" tofile="${deploy.effective.pom.xml.file}">
<filterchain>
<replaceregex pattern="^(Created by" replace='<!-- \1' />
<replaceregex pattern="^<.xml .*>(<project>)" replace='--> \1' />
<replaceregex pattern="^*+$" replace='' />
</filterchain>
</move>

Solution: Either add XML comments in the generation markup, or only output the XML proper to the output file, leaving the text out of it.



Vincent Siveton added a comment - 02/Aug/08 08:11 AM

We could make xml comments only if reactorProjects is empty.
If reactorProjects is not empty, the output file appends all effective poms in one file and thus it is an invalid xml file.


Jürgen Hermann added a comment - 04/Aug/08 06:05 AM

> We could make xml comments only if reactorProjects is empty.
Well, that'd help for a certain number of cases.

> If reactorProjects is not empty, the output file appends all effective poms in one file and thus it is an invalid xml file.
That can be solved by adding an outer root element around the POMs, which then allows to select the needed POMs by standard tools (XPath) instead of trickery that'll likely break in later releases. It certainly doesn't make automatic processing any harder, just the opposite.


Vincent Siveton added a comment - 23/Aug/08 03:55 PM

Fixed in r688412, snapshot deployed.

For reactorProjects, I added a <projects/> tag as suggested.