I\'m trying to basically generate XSD schemas from my model classes annotated in JAXB using a Maven plugin. Here\'s the relevant code in my POM:
Improving on Naftuli Tzvi Kay's answer, I found it more convenient to use the now-current version 2.2 of the jaxb2-maven-plugin, like in this sample (as the 2.x version requires slightly different configuration):
jaxb2-maven-plugin
org.codehaus.mojo jaxb2-maven-plugin 2.2 schemagen generate-resources src/main/java/com/foo/model/xml ${project.build.directory}/schemas
See the plugin documentation for more details.