I tried to generate Jaxb Classes from XSD using jaxb2-maven-plugin.
I am able to get the jaxb classes in a package but my other packages are getting deleted. What is the reason for this? How to over come this? please can you give suggestions.
Below is what I tried
<bulid>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>src/main/xsd</schemaDirectory>
<outputDirectory>src/main/java</outputDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</bulid>
and xsd look like this :
<?xml version="1.0" encoding="UTF-8"?><xsd:schema targetNamespace="com.test.jaxb.model"
xmlns:ns="com.test.jaxb.model" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="TestResults">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="testSuites" type="Q1:TestSuiteRun"/>
</xsd:sequence>
<xsd:attribute name="testProject" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="TestCaseRun">
<xsd:complexContent>
<xsd:extension base="Q1:TestRun">
<xsd:sequence>
<xsd:element name="result" type="Q1:Severity"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="variations" type="Q1:VariationRun">
</xsd:element>
</xsd:sequence>
<xsd:attribute name="variationCount" type="xsd:int"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
I have given targetNamespace="com.test.jaxb.model" but after generation I am only able to see jaxb classes under package name : model.jaxb.test.com..
Why so the package name is geting reversed and why is my other packages getting deleted ?