Hi Andrew, >From the XML specification, specifically the section dealing with comments >(http://www.w3.org/TR/REC-xml/#sec-comments), what you have below is not a >viable XML file:
----- 2.5 Comments [Definition: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processor may, but need not, make it possible for an application to retrieve the text of comments. For compatibility, the string " -- " (double-hyphen) must not occur within comments.] Parameter entity references must not be recognized within comments. ----- So I doubt there is any way that maven can provide a fix that will suit your needs as any changes they make would cause their XML parser to be non-conformant to the XML specification. Given the specific case you were targeting with your request, perhaps change "--gen" to "==gen" with note at the start of the comment along the lines of "all instances of == within this comment must be changed to -- when uncommenting". Hope this helps, Dan -----Original Message----- From: Andrew Pennebaker [mailto:apenneba...@42six.com] Sent: Tuesday, September 17, 2013 12:55 PM To: Maven Issues Subject: Maven parsing pom.xml incorrectly I'm using Thrift in my Maven project, compiling my .thrift code to .java as part of the generate-sources step. To do this, I use the maven antrun plugin in my pom.xml, which executes a command line call to the thrift executable, and sends it the appropriate argument flags, such as "-out" and "--gen". However, when I comment out this plugin with the standard XML comment syntax <!-- ... -->, Maven fails to parse the pom file. It doesn't like the fact that the comment contains --gen, expecting the comment to end right there. Can we please improve Maven's comment syntax parsing for pom.xml?