I upgraded to groovy 2 release and now my build is broken.
It fails when importing classes: groovy.json.JsonSlurper and XmlSlurper.
I have checked http://groovy.codehaus.org/gapi/ and cannot find these classes anymore. Do they still exist in groovy 2? Or have they moved somewhere?
The groovy.jar
distributed with groovy 2 has been split out to contain just the bare minimum, with all the additional modules (XML, SQL, JSON, etc.) in separate jars. However, in the embeddable
directory, you'll find a jar file groovy-all-2.0.0.jar
which contains groovy and all the modules together, like previous versions. The easiest way to migrate is to use this jar file.
If you're using Maven Central, you can use an artifactId
of groovy-all
to get everything, or groovy
(plus modules) to have finer grained control over your dependencies. Here's a list of the modules available on Maven Central: http://search.maven.org/#search|ga|1|g%3A%22org.codehaus.groovy%22
Never mind. Need to include groovy-xml and groovy-json jars. These were split from groovy's jar. See: http://www.infoq.com/articles/new-groovy-20
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With