Plugins You can find out about all the publicly available Grails plugins.

Domain Schemagen

  • Tags: /
  • Latest: 1.0
  • Last Updated: 18 January 2012
  • Grails version: 1.3.7
  • Authors: null
1 vote
compile "org.grails.plugins:domain-schemagen:1.0"

 Documentation  Source


Runs schemagen on your Groovy domain classes to output an XML Schema representation of your domain.


grails install-plugin domain-schemagen


Domain Schemagen provides a new script to scan your domain classes and generate an XML Schema from them. It also respects all standard java XML annotations to manipulate schema generation. i.e. @XmlType, @XmlElement, @XmlAttribute, etc. The only part that doesn't work is @XmlSchema found in

This can be circumvented by using @XmlType(namespace="yournamespace"), though be sure you do it for all classes in a specific package, otherwise you'll have multiple schemas generated.


grails domain-schemagen [-option=value]

The default output directory is web-app/schemas

The default src directory is grails-app/domain

  • -outputDir= override the default output directory.
  • -pkg= Specify specific packages for schemagen, multiples separated by comma. Cannot use with -classes=
  • -classes= Specify specific classes for schemagen, multiples separated by comma. Cannot use with -pkg=
  • -srcDir= Specify alternate directory for Groovy source. Yes, that means you're not limited to Domain classes!
  • -help See this message

YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: YourKit Java Profiler and YourKit .NET Profiler