Using XmlParser in archetype-post-generate.groovy script for maven archetype

Viewed 993

Since upgrading to a newer version of maven (3.5.2) my archetype-post-generate groovy script in my own maven archetype has stopped working. It has trouble to create a new XMLParser (new XmlParser()). Seems that this package is not longer in basic groovy installation? How can I do XML processing in archetype groovy scripts?

Thanks and Regards

1 Answers

Core Groovy no longer includes support for working with XML, JSON, etc. Using the groovy-all artifact ID might do it for you.

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>3.0.5</version>
      <type>source</type>
      <scope>provided</scope>
    </dependency>
Related