Created
November 28, 2012 02:41
-
-
Save jurberg/4158702 to your computer and use it in GitHub Desktop.
Groovy script to generate JAXB classes from an XSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
.getBuildDependencies() | |
.join(System.getProperty("path.separator")) | |
Ant.taskdef(name: "xjc", | |
classname: "com.sun.tools.xjc.XJCTask", | |
classpath: classpath) | |
Ant.xjc(schema: "etc/schema/books.xsd", | |
destDir: "src/java", | |
'package': "com.microsoft.books") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was helpful. Thanks