title: jaxb how to exclude objectfactory from generting
body: <p>while creating java classes from xsd, it creates ObjectFactory.java which I need to avoid from creation. What is the best way to do that? Since it is created runtime, can't hardcode any path etc in POM.xml. Using maven-jaxb2 plugin.</p>
  
  <p>POM</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
      &lt;properties&gt;
          &lt;xsd.build.dir&gt;${basedir}/src/main/resources&lt;/xsd.build.dir&gt;
          &lt;generated.source.location&gt;${basedir}/target/generated-sources/src&lt;/generated.source.location&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jvnet.jaxb2_commons&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb2-basics&lt;/artifactId&gt;
              &lt;version&gt;0.6.4&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.13.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;generate&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;generateDirectory&gt;${generated.source.location}&lt;/generateDirectory&gt;
                      &lt;schemaDirectory&gt;${xsd.build.dir}&lt;/schemaDirectory&gt;
                      &lt;episode&gt;true&lt;/episode&gt;
                      &lt;addIfExistsToEpisodeSchemaBindings&gt;true&lt;/addIfExistsToEpisodeSchemaBindings&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.4&lt;/version&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;jar&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
  
          &lt;/build&gt;
  &lt;/project&gt; 
  </code></pre>
  
  <p>Why I want it -> basically I am using below annotation to create complex type and I don't want xjc to create 'test' class but I don't know how to suppress it.
  Since it creates test, objectfactory shows error and objectfactory is not needed anyway.</p>
  
  <pre><code>&lt;xs:complexType name="test"&gt;
          &lt;xs:annotation&gt;
              &lt;xs:appinfo&gt;
                  &lt;jaxb:class name="test"
                      implClass="somepackage.test123" /&gt;
              &lt;/xs:appinfo&gt;
          &lt;/xs:annotation&gt;
      &lt;/xs:complexType&gt;
  </code></pre>