You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by Andrew Pennebaker <ap...@42six.com> on 2013/09/17 18:55:23 UTC
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?
RE: Maven parsing pom.xml incorrectly
Posted by Brian Withnell <bw...@42six.com>.
Thanks. Makes sense.
On Sep 18, 2013 12:08 PM, "Dan Taylor" <Da...@merge.com> wrote:
> 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:apennebaker@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?
>
RE: Maven parsing pom.xml incorrectly
Posted by Dan Taylor <Da...@Merge.com>.
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:apennebaker@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?
Re: Maven parsing pom.xml incorrectly
Posted by Greg Trasuk <tr...@stratuscom.com>.
Hi Andrew:
Unfortunately, that's in the XML spec, not Maven. '--' is not permitted
in comments. I'm not aware of any workaround, though I'd be interested
to hear one. Putting the line that contains the offending '--' does not
work.
Sorry,
Greg.
On Wed, 2013-09-18 at 04:59, Dennis Lundberg wrote:
> This mailing list is used only for automated responses from our issue tracker.
> Please use users@maven.apache.org instead.
>
> On Tue, Sep 17, 2013 at 6:55 PM, Andrew Pennebaker
> <ap...@42six.com> wrote:
> > 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?
>
>
>
> --
> Dennis Lundberg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven parsing pom.xml incorrectly
Posted by Dennis Lundberg <de...@apache.org>.
This mailing list is used only for automated responses from our issue tracker.
Please use users@maven.apache.org instead.
On Tue, Sep 17, 2013 at 6:55 PM, Andrew Pennebaker
<ap...@42six.com> wrote:
> 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?
--
Dennis Lundberg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Maven parsing pom.xml incorrectly
Posted by Dan Taylor <Da...@Merge.com>.
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:apennebaker@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?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org