The XSD2Java plugin offers a single goal:
To run the plugin, add the following section to your POM:
<build> <plugins> <plugin> <groupId>org.apache.axis2.maven2</groupId> <artifactId>axis2-xsd2java-maven-plugin</artifactId> <executions> <execution> <goals> <goal>xsd2java</goal> </goals> </execution> <configuration> <outputFolder>${project.basedir}/target/generated-sources/java</outputFolder> <xsdFiles> <xsdFile>${project.basedir}/src/main/resources/xsd/attribute.xsd</xsdFile> </xsdFiles> <namespace2Packages> <namespace2Package>http://www.example.org/schema/test=org.example.schema.test</namespace2Package> </namespace2Packages> </configuration> </executions> </plugin> </plugins> </build>
The plugin will be invoked automatically in the generate-sources phase. You can also invoke it directly from the command line by running the command
mvn xsd2java:xsd2java
The plugin reads the specified XSD files and creates the matching Axis2 ADB Java bean classes. The mapping from XSD target-namespaces to Java packages is specified with the namespace2Packages
configuration element above.
See the detailed documentation on properties for how to configure the goal.