Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Groovy script to generate JAXB classes from an XSD
// Add the following to BuildConfig.groovy:
// build('com.sun.xml.bind:jaxb-xjc:2.1')
// build('com.sun.xml.bind:jaxb-impl:2.1')
target('generateSources': "Generate JAXB classes from a schema") {
def classpath = grailsSettings
Ant.taskdef(name: "xjc",
classname: "",
classpath: classpath)
Ant.xjc(schema: "etc/schema/books.xsd",
destDir: "src/java",
'package': "")

This comment has been minimized.

Copy link

jschloer commented Aug 20, 2014

This was helpful. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.