title: XJC Maven Plugin(jaxb2-maven-plugin) Java 11 Migration Issues
body: <p>I am currently working on java 11 migration project where jaxb2-maven-plugin has been used for XJC task. As XJC executable is not present in the JDK 11 version, I am getting below mentioned errors.</p>
  <pre><code>    [ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.2:xjc (xjc-schema1) on project paymaster-service: Execution xjc-schema1 of goal org.codehaus.mojo:jaxb2-maven-plugin:2.2
  :xjc failed: A required class was missing while executing org.codehaus.mojo:jaxb2-maven-plugin:2.2:xjc: com/sun/codemodel/CodeWriter
  [ERROR] -----------------------------------------------------
  [ERROR] realm =    plugin&gt;org.codehaus.mojo:jaxb2-maven-plugin:2.2
  [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
  [ERROR] urls[0] = file:/C:/Users/voletis/.m2/repository/org/codehaus/mojo/jaxb2-maven-plugin/2.2/jaxb2-maven-plugin-2.2.jar
  [ERROR] urls[1] = file:/C:/Users/voletis/.m2/repository/javax/xml/bind/jaxb-api/2.2.11/jaxb-api-2.2.11.jar
  [ERROR] urls[2] = file:/C:/Users/voletis/.m2/repository/org/glassfish/jaxb/jaxb-core/2.2.11/jaxb-core-2.2.11.jar
  [ERROR] urls[3] = file:/C:/Users/voletis/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.jar
  [ERROR] urls[4] = file:/C:/Users/voletis/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar
  [ERROR] urls[5] = file:/C:/Users/voletis/.m2/repository/org/glassfish/jaxb/jaxb-jxc/2.2.11/jaxb-jxc-2.2.11.jar
  [ERROR] urls[6] = file:/C:/Users/voletis/.m2/repository/com/thoughtworks/qdox/qdox/2.0-M3/qdox-2.0-M3.jar
  [ERROR] urls[7] = file:/C:/Users/voletis/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
  [ERROR] urls[8] = file:/C:/Users/voletis/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
  [ERROR] urls[9] = file:/C:/Users/voletis/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
  [ERROR] urls[10] = file:/C:/Users/voletis/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
  [ERROR] urls[11] = file:/C:/Users/voletis/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
  [ERROR] urls[12] = file:/C:/Users/voletis/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
  [ERROR] urls[13] = file:/C:/Users/voletis/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
  [ERROR] urls[14] = file:/C:/Users/voletis/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.5/plexus-compiler-api-2.5.jar
  [ERROR] urls[15] = file:/C:/Users/voletis/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
  [ERROR] urls[16] = file:/C:/Users/voletis/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
  [ERROR] Number of foreign imports: 1
  [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
  [ERROR]
  [ERROR] -----------------------------------------------------
  [ERROR] : com.sun.codemodel.CodeWriter
  [ERROR] -&gt; [Help 1]
  [ERROR]
  </code></pre>
  <p>Below is my pom.xml</p>
  <pre><code>&lt;plugin&gt;
     &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
     &lt;artifactId&gt;jaxb2-maven-plugin&lt;/artifactId&gt;
     &lt;version&gt;2.2&lt;/version&gt;
     &lt;executions&gt;
        &lt;execution&gt;
           &lt;id&gt;xjc-schema1&lt;/id&gt;
           &lt;goals&gt;
              &lt;goal&gt;xjc&lt;/goal&gt;
           &lt;/goals&gt;
           &lt;configuration&gt;
              &lt;target&gt;2.2&lt;/target&gt;
              &lt;schemaFiles&gt;SubmitPaymentBatch/SubmitPaymentRequest.xsd&lt;/schemaFiles&gt;
              &lt;packageName&gt;app.test.services.submitpayment.request&lt;/packageName&gt;
              &lt;clearOutputDir&gt;false&lt;/clearOutputDir&gt;
           &lt;/configuration&gt;
        &lt;/execution&gt;
  &lt;/plugin&gt;
  </code></pre>
  <p>I have added necessary dependencies like JAXB, JAXB-IMPL, etc., as per java 11 requirements. But still not able to fix the issues. Do you have any suggested fix for this ? Thank in Advance.</p>