title: Migrating from jaxb xjc generation to jakarta and Java 17
body: <p>We are in the process of investigating the migration of our application from JDK8 to JDK17. Some of our modules use wsdl based web services, some others make use of .xsd schemas etc. Regardless, we make use of JAXWS and JAXB apis that are now removed from JDK since version 11 and moved to Jakarta.</p>
  <p>I have successfully started generating sources from .wsdl and .xsd files using the jakarta dependencies and the source is properly generated with jakarta imports</p>
  <pre><code>import jakarta.xml.bind.JAXBElement;
  import jakarta.xml.bind.annotation.XmlAccessType;
  import jakarta.xml.bind.annotation.XmlAccessorType;
  import jakarta.xml.bind.annotation.XmlElementRef;
  </code></pre>
  <p>whereas previously it was using <code>javax.xml.bind.</code> stuff which is not available at compile time anymore. My problem is that although I have successfully generated schema based sources, the new generators produce different code (class names, accessors etc.) and I'd like to confirm that this is the intended behavior before proceeding with a refactor.</p>
  <p>Example:</p>
  <p>Our .xsd contains the following:</p>
  <pre><code>&lt;xsd:complexType name=&quot;ForkStepType&quot;&gt;
      &lt;xsd:annotation&gt;
          &lt;xsd:appinfo&gt;
              &lt;jxb:class name=&quot;ForkStep&quot;/&gt;
          &lt;/xsd:appinfo&gt;
      &lt;/xsd:annotation&gt;
      &lt;xsd:complexContent&gt;
          &lt;xsd:extension base=&quot;tns:LinearStepType&quot;&gt;
              &lt;xsd:sequence/&gt;
              &lt;xsd:attribute name=&quot;forkLevel&quot; type=&quot;tns:ForkLevelType&quot; use=&quot;required&quot;/&gt;
          &lt;/xsd:extension&gt;
      &lt;/xsd:complexContent&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  <p>The <strong>old</strong> xjc generator using jaxb version <code>2.2.11</code> would generate a class named <code>ForkStep</code>, I'm guessing based on the <code>jxb:class</code> element. The jakarta <code>3.0.1</code> generator on the other hand generates a class named <code>ForkStepType</code> which I'm guessing comes from the <code>xsd:complexType</code> element.</p>
  <p>Is this expected behavior? Were the old implementations incorrect when it comes to interpreting the specification or is there a flag/spec target version that I should be aware of in order to properly reproduce our app's existing behavior?</p>