Generating JAXB artifacts from XSD/WSDL through Maven
The maven-jaxb2-plugin can be used to generate the java classes from both XSD/WSDL.Plugin configuration in Pom.xml
The below plug in configuration can be used in the pom.xml file to generate the sources.<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.3</version>
<executions>
<execution>
<id>app1-stub-generation</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>*.xsd</include>
</schemaIncludes>
<generatePackage>com.thomson.ecom.service.bean.demo</generatePackage>
<clearOutputDir>false</clearOutputDir>
<generateDirectory>src/main/java</generateDirectory>
<strict>true</strict>
</configuration>
</execution>
</executions>
</plugin>
Change the include accordingly to generate for wsdl - <include>*.wsdl</include>
Generate the sources
To generate the sources, Right click on pom.xml-->Run As-->Maven generate-sources
This will generate all the java classes to src/main/java