maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Taylor <>
Subject RE: bug in parsing file ... comments
Date Wed, 18 Sep 2013 16:05:59 GMT
Hi Brian,

>From the XML specification, specifically the section dealing with comments (,
what you have below is not a viable XML file:



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


-----Original Message-----
From: Brian Withnell [] 
Sent: Tuesday, September 17, 2013 2:46 PM
Subject: bug in parsing file ... comments

We ran into a parsing bug that prevents commenting out an option with a command line for maven.
We tried commenting out (for testing purposes) the following plugin, which contains the "thrift
--gen" command. The "--gen"
caused a parse error in the file (looks like it thinks it needs to have --> because it
is in a comment rather than --> as the only thing that matters.
It would be *great* if it allowed nesting of comments, but I'll take that it just doesn't
barf on valid command structures. Because the following is a comment, you *should* be able
to paste it into any pom file and have maven process the file properly.

      <!--  plugin>







      </plugin -->

      <!-- plugin>








                <mkdir dir="target/generated-sources/" />

                <apply executable="/usr/local/bin/thrift" parallel="false">

the line below in a comment causes problems:

                  <arg value="--gen" />

                  <arg value="java" />

                  <arg value="-out" />

                  <arg value="target/generated-sources/" />

                  <fileset dir="src/">

                    <include name="*.thrift" />










      </plugin -->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message