title: How to generate java classes into source folder using jaxb2-maven-plugin?
body: <p>I use jaxb2-maven-plugin to generate java classes.
  There is plugin properties: </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.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;xjc&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;xjc&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;!-- The package of your generated sources --&gt;
                  &lt;packageName&gt;com.bcap.me.JaxB&lt;/packageName&gt;
                  &lt;sources&gt;
                      &lt;source&gt;src/main/resources/xsds/pos.xsd&lt;/source&gt;
                  &lt;/sources&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>After running <code>mvn clean compile</code> the plugin creates classes in the <code>target\classes\com\bcap\me\JaxB</code> directory.
  But i need to have classes in the source folder (package): <code>src\main\java\com\bcap\me\JaxB</code>
  How to do this?</p>
  
  <p><strong>UPDATE</strong>
  I add <code>outputDirectory</code> property, but i am not sure about the correctness of this approach:</p>
  
  <pre><code>&lt;!--&lt;packageName&gt;com.bcap.me.JaxB&lt;/packageName&gt;--&gt;
  &lt;outputDirectory&gt;src/main/java/com/bcap/me/JaxB&lt;/outputDirectory&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I solved my case like:</p>
  
  <pre><code>  &lt;execution&gt;
                          &lt;id&gt;xjc_pos&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;xjc&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;!-- The package of your generated sources --&gt;
                              &lt;packageName&gt;com.bcap.me.JaxB&lt;/packageName&gt;
                              &lt;outputDirectory&gt;src/main/java&lt;/outputDirectory&gt;
                              &lt;sources&gt;
                                  &lt;source&gt;src/main/resources/xsds/pos.xsd&lt;/source&gt;
                              &lt;/sources&gt;
                              &lt;generateEpisode&gt;false&lt;/generateEpisode&gt;
                              &lt;clearOutputDir&gt;false&lt;/clearOutputDir&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
  </code></pre>
  
  <p>Thanks to @ulab </p>