title: Using MOJO build-helper-maven-plugin to add more source folders to MAVEN
body: <p>I red more discussion about how to add more source folders to MAVEN and I choose to use the MOJO's <strong>build-helper-maven-plugin</strong> plugin. The <strong>pom.xml</strong> looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 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;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;my.maven.tests&lt;/groupId&gt;
    &lt;artifactId&gt;helper&lt;/artifactId&gt;
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.8&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;add-gen-source&lt;/id&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;add-source&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;sources&gt;
                 &lt;source&gt;src-gen/gen/java&lt;/source&gt;
                &lt;/sources&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
            &lt;execution&gt;
              &lt;id&gt;add-extra-source&lt;/id&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;add-source&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;sources&gt;
                  &lt;source&gt;src/extra/java&lt;/source&gt;
                &lt;/sources&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.6&lt;/source&gt;
            &lt;target&gt;1.6&lt;/target&gt;
            &lt;encoding&gt;UTF-8&lt;/encoding&gt;
            &lt;includes&gt;
              &lt;include&gt;src/main/java/**/*.java&lt;/include&gt;
              &lt;include&gt;src-gen/gen/java/**/*.java&lt;/include&gt;
              &lt;include&gt;src/extra/java/**/*.java&lt;/include&gt;
            &lt;/includes&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Using the command <code>mvn clean compile</code> the build finishes fine, without errors, but no classes are generated. </p>
  
  <p>I am sure I made something wrong but I cannot figure out. </p>