title: Why doesn't Eclipse m2e automatically add generated source folder to classpath?
body: <p>I'm using 2018-12 with Java 8, but I'm running Eclipse itself with Java 11.</p>
  
  <p>I have version "1.10.0.20181127-2120" of the m2e plugin.</p>
  
  <p>I have a bunch of projects with similar characteristics.  Maven projects run with Spring Boot. They are all stored in git.</p>
  
  <p>For some reason, one of those projects was somewhat brain-damaged this morning.  It still would build fine from the command line.  Eclipse still knew it was a maven project, but it had no source folders. The .classpath file wasn't empty, it was just very minimal.</p>
  
  <p>I got this particular problem resolved by simply copying the .classpath file from a similar project into this project.  That fixed most of the problems, but I remembered that this one project uses a code generator plugin along with the "build-helper-maven-plugin" to indicate where the source is being generated.  I found that Eclipse didn't have the generated sources folder as a source folder.  I thought adding the "build-helper-maven-plugin" reference was what I needed to do to make Eclipse M2E to automatically detect this, but it doesn't appear to be working.</p>
  
  <p>Once I manually added the generated sources folder as a source folder, that cleaned out the last compile errors.</p>
  
  <p>This is a hopefully relevant excerpt from my pom:</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;executions&gt;
                  &lt;execution&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;${project.build.directory}/java-gen&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.jsonschema2pojo&lt;/groupId&gt;
              &lt;artifactId&gt;jsonschema2pojo-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.4.34&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;sourcePaths&gt;
                      &lt;sourcePath&gt;${basedir}/src/main/schema/...&lt;/sourcePath&gt;
                      &lt;sourcePath&gt;${basedir}/src/main/schema/...&lt;/sourcePath&gt;
                  &lt;/sourcePaths&gt;
                  &lt;targetPackage&gt;...&lt;/targetPackage&gt;
                  &lt;annotationStyle&gt;jackson2&lt;/annotationStyle&gt;
                  &lt;useCommonsLang3&gt;true&lt;/useCommonsLang3&gt;
                  &lt;useDoubleNumbers&gt;true&lt;/useDoubleNumbers&gt;
                  &lt;includeAccessors&gt;true&lt;/includeAccessors&gt;
                  &lt;includeAdditionalProperties&gt;true&lt;/includeAdditionalProperties&gt;
                  &lt;sourceType&gt;jsonschema&lt;/sourceType&gt;
                  &lt;generateBuilders&gt;true&lt;/generateBuilders&gt;
                  &lt;includeJsr303Annotations&gt;true&lt;/includeJsr303Annotations&gt;
              &lt;/configuration&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;/plugin&gt;
  </code></pre>
  
  <p><strong>Update</strong>:</p>
  
  <p>Deleting the Eclipse project and reimporting from git made no difference.  Same result.</p>