Maven plugin and xml files

281 views
Skip to first unread message

ph...@riand.com

unread,
May 16, 2015, 6:01:44 PM5/16/15
to wr...@googlegroups.com
I'm running a build time optimization using maven and a wro.xml file. Now, when the xml file is incorrect (syntax or even back content), it generates an error like:

[ERROR] Exception occured while processing: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: < @ line 1, column 1.
   <?xml version="1.0" encoding="UTF-8"?>
   ^

1 error
, class: org.codehaus.groovy.control.MultipleCompilationErrorsException,caused by: 
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: < @ line 1, column 1.
   <?xml version="1.0" encoding="UTF-8"?>
   ^

1 error

It seems that a failure to parse/interpret the XML triggers the groovy model, leading to an obscure error message.

alex.o...@gmail.com

unread,
May 16, 2015, 6:24:13 PM5/16/15
to wr...@googlegroups.com, wr...@googlegroups.com
Indeed, I'm aware of this problem. The reason is the default model factory used, which attempts to parse all known formats (xml, groovy, json) before failing. It would probably be a better idea to use XmlModelFactory by default.

Alex


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages