title: How do you generate resources for inclusion in src/main/resources without that triggering a subsequent build in eclipse
body: <p>I'm trying to achieve the following in Eclipse:</p>
  
  <p>When a source file changes, run an custom class that's included as part of the project dependencies, this class generates a file which needs to be placed into src/main/resources (such that it will get checked into source control by any developer working on the project).  I'd even settle for /generated rather than src/main/resources.</p>
  
  <p>I have the following, which seems to do the right thing, however even though the generated file is being placed into /generated, it triggers a further eclipse build, so essentially a circular loop of builds.</p>
  
  <p>The following triggers m2e into action:</p>
  
  <pre><code>    &lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
                  &lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;lifecycleMappingMetadata&gt;
                          &lt;pluginExecutions&gt;
                              &lt;pluginExecution&gt;
                                  &lt;pluginExecutionFilter&gt;
                                      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                                      &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                                      &lt;versionRange&gt;[1,)&lt;/versionRange&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;java&lt;/goal&gt;
                                      &lt;/goals&gt;
                                  &lt;/pluginExecutionFilter&gt;
                                  &lt;action&gt;
                                      &lt;execute&gt;
                                          &lt;runOnConfiguration&gt;false&lt;/runOnConfiguration&gt;
                                          &lt;runOnIncremental&gt;true&lt;/runOnIncremental&gt;
                                      &lt;/execute&gt;
                                  &lt;/action&gt;
                              &lt;/pluginExecution&gt;
                          &lt;/pluginExecutions&gt;
                      &lt;/lifecycleMappingMetadata&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  </code></pre>
  
  <p>The following triggers the custom class:</p>
  
  <pre><code>    &lt;plugins&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;SchemaGenerator&lt;/id&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;java&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;mainClass&gt;jit.SchemaGenerator&lt;/mainClass&gt;
                          &lt;arguments&gt;
                              &lt;argument&gt;${project.basedir}/generated&lt;/argument&gt;
                              &lt;argument&gt;schema.xml&lt;/argument&gt;
                          &lt;/arguments&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>