Java Maven Jaxb Generate Plugin To Read Xsd Files Stack
Mojo that creates compile-scope Java source or binaries from XML schema(s) by invoking the JAXB XJC binding compiler. This implementation is tailored to use the JAXB Reference Implementation from project Kenai. Note that the XjcMojo was completely re-implemented for the 2.x versions. Its configuration semantics and parameter set is not necessarily backwards compatible with the 1.x plugin How can i instruct the maven jaxb plugin to generate jaxb classes using all schema files in the above directory? I can get it to generate the class files if i specify one of the folders but i cant get i dont know how to include all three folders.



You can use JAXB to generate classes automatically to match this XSD using this command line (provided your JDK's bin folder is on your path) xjc SimpleModel.xsd This will generate a package based on the namespace of your XSD (here mycorp.schemas.simplemodel) with the following classes : ObjectFactory.java package-info.java Person.java Generating a Java Class From XSD The JAXB-2 Maven plugin uses the JDK-supplied tool XJC, a JAXB Binding compiler tool that generates Java classes from XSD (XML Schema Definition). Let's create a simple user.xsd file and use the JAXB-2 Maven plugin to generate Java classes from this XSD schema:



Mojo that creates test-scope Java source or binaries from XML schema(s) by invoking the JAXB XJC binding compiler. This implementation is tailored to use the JAXB Reference Implementation from project Kenai. Note that the TestXjcMojo was completely re-implemented for the 2.x versions. Its configuration semantics and parameter set is not necessarily backwards compatible with the 1.x plugin We also use JAXB to create code from XSDs (using the mojo.codehaus.org/jaxb2-maven-plugin) during the Maven build, and Eclipse is quite happy with that. You only need to manually add the folder under target/with the generated code to Eclipse's "build path". - sleske Jun 11, 2014 at 23:17
I use jaxb2-maven-plugin to generate java classes. There is plugin properties: You can use JAXB to generate classes automatically to match this XSD using this command line (provided your JDK's bin folder is on your path) xjc SimpleModel.xsd This will generate a package based on the namespace of your XSD (here mycorp.schemas.simplemodel) with the following classes : ObjectFactory.java package-info.java Person.java. Generating a Java Class From XSD The JAXB-2 Maven plugin uses the JDK-supplied tool XJC, a JAXB Binding compiler tool that generates Java classes from XSD (XML Schema Definition). Let's create a simple user.xsd file and use the JAXB-2 Maven plugin to generate Java classes from this XSD schema: