title: Java classes generated using maven exec-maven-plugin “target” folder are not compiled
body: <p>I have a maven project which uses exec-maven-plugin to generate the java classes into the target/generated-sources. 
  The java classes generated underneath is never compiled during mvn clean install.</p>
  
  <pre><code>           &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;3.0.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;add-source&lt;/id&gt;
                          &lt;phase&gt;prepare-package&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;${project.build.directory}/foldername&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.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.6.0&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;add-sources&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;java&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;phase&gt;prepare-package&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;mainClass&gt;mainclass&lt;/mainClass&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>Do i have to use MOJO for this?</p>