title: Create a common xsd generated class to be used by other packages
body: <p>I am trying to use the same generated class but in separate packages.  So the structure should look something like this:</p>
  
  <pre><code>com.test.common
       -commonType.java
  com.test.A
       -objectA.java
  com.test.B
       -objectB.java
  </code></pre>
  
  <p>But i keep getting this:</p>
  
  <pre><code>com.test.common
       -commonType.java
  com.test.A
       -objectA.java
       -commonType.java
  com.test.B
       -objectB.java
       -commonType.java
  </code></pre>
  
  <p>My common.xsd looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xs:schema elementFormDefault="qualified" version="1.0"
      targetNamespace="http://test.com/magic/common"
      xmlns="http://test.com/magic/common"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      jaxb:version="2.0"&gt;
  
      &lt;xs:complexType name="CommonType"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="name" type="xs:string" /&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>the objectA.xsd looks like</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xs:schema elementFormDefault="qualified" version="1.0"
      targetNamespace="http://test.com/magic/objectA"
      xmlns:common="http://test.com/magic/common"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      jaxb:version="2.0"&gt;
  
      &lt;xs:complexType name="ObjectA"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="size" type="xs:string" /&gt;
              &lt;xs:element name="commonA" type="common:CommonType" /&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>And objectB.xsd looks like:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xs:schema elementFormDefault="qualified" version="1.0"
      targetNamespace="http://test.com/magic/objectB"
      xmlns:common="http://test.com/magic/common"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      jaxb:version="2.0"&gt;
  
      &lt;xs:complexType name="ObjectB"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="version" type="xs:string" /&gt;
              &lt;xs:element name="commonB" type="common:CommonType" /&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>I have a common binding file common.xjb which looks like this:</p>
  
  <p></p>
  
  <pre><code>    &lt;jxb:bindings schemaLocation="../xsd/common.xsd" node="/xsd:schema"&gt;
          &lt;jxb:schemaBindings&gt;
              &lt;jxb:package name="com.test.common"/&gt;
          &lt;/jxb:schemaBindings&gt;
      &lt;/jxb:bindings&gt;
  </code></pre>
  
  <p></p>
  
  <p>And finally my maven job looks like this: </p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;args&gt;
                      &lt;arg&gt;-Xequals&lt;/arg&gt;
                  &lt;/args&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.jvnet.jaxb2_commons&lt;/groupId&gt;
                          &lt;artifactId&gt;jaxb2-basics&lt;/artifactId&gt;
                          &lt;version&gt;0.6.3&lt;/version&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
                  &lt;episode&gt;true&lt;/episode&gt;
                  &lt;extension&gt;true&lt;/extension&gt;
                  &lt;verbose&gt;true&lt;/verbose&gt;
                  &lt;generateDirectory&gt;src/main/java&lt;/generateDirectory&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;common&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;generatePackage&gt;com.test.common&lt;/generatePackage&gt;
                          &lt;schemaIncludes&gt;
                              &lt;includeSchema&gt;xsd/common.xsd&lt;/includeSchema&gt;
                          &lt;/schemaIncludes&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;login&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;generatePackage&gt;com.test.A&lt;/generatePackage&gt;
                          &lt;bindingIncludes&gt;
                              &lt;includeBinding&gt;xjb/commons.xjb&lt;/includeBinding&gt;
                          &lt;/bindingIncludes&gt;
                          &lt;schemaIncludes&gt;
                              &lt;includeSchema&gt;xsd/objectA.xsd&lt;/includeSchema&gt;
                          &lt;/schemaIncludes&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;alert&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;generatePackage&gt;com.test.B&lt;/generatePackage&gt;
                          &lt;bindingIncludes&gt;
                              &lt;includeBinding&gt;xjb/commons.xjb&lt;/includeBinding&gt;
                          &lt;/bindingIncludes&gt;
                          &lt;schemaIncludes&gt;
                              &lt;includeSchema&gt;xsd/objectB.xsd&lt;/includeSchema&gt;
                          &lt;/schemaIncludes&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>