Glassfish v3 is going to be based on Maven2, and I've been helping them to get it right. One of the work is to invoke JAXB's schema compiler to compile a DTD with XJC plugins. Once you know what to do, this is easy thanks to the excellent maven-jaxb2-plugin.

As with everything else in Maven, the hard part is to know how to do it. I thought this example might be useful for other folks, so decided to post it here. The crucial portion is the plugin configuration in <build>:

 org.jvnet.jaxb2.maven2 maven-jaxb2-plugin    generate   src/main/jaxb --> true DTD  *.dtd   *.jaxb   -Xinject-listener-code       org.jvnet.jaxb2-commons property-listener-injector 1.0    

The dependencies section inside the plugin element can be used to specify additional XJC plugins. If you'd like to use more recent version of the JAXB RI, you can specify a dependency to XJC here to do so, like this:

 com.sun.xml.bind jaxb-xjc 2.1.2  

The complete sample project is also available.