title: How to add generated sources of dependent project to build path?
body: <p>I'm using Intellij and a coworker is using Eclipse.  There is a <code>datamodel</code> project that most components depend on that has all the JPA code.  </p>
  
  <p>One of <code>datamodel</code> dependencies is <code>utils</code>.  In <code>utils</code> there are generated sources.  My coworker in Eclipse, adds the target/generated-sources of <code>utils</code> to the build path and everything builds and runs fine within Eclipse.  </p>
  
  <p>In Intellij, when I go to Project Structure, do I need to go to <code>utils</code> and add the target/generated-sources of <code>utils</code> as a <code>Source</code> folder to be equivalent?  </p>
  
  <p>Or do I need to add that module as a dependency?</p>
  
  <p>Edit:
  In utils pom:</p>
  
  <pre><code>         &lt;plugin&gt;
             &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
             &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
             &lt;executions&gt;
               &lt;execution&gt;
                 &lt;id&gt;generate-sources&lt;/id&gt;
                 &lt;phase&gt;generate-sources&lt;/phase&gt;
                 &lt;configuration&gt;
                   &lt;tasks&gt;
                     &lt;mkdir dir="target/generated-sources" /&gt;
                     &lt;exec executable="protoc"&gt;
                       &lt;arg value="--java_out=target/generated-sources" /&gt;
                       &lt;arg value="src/main/resources/utilities.proto" /&gt;
                     &lt;/exec&gt;
                   &lt;/tasks&gt;
                   &lt;sourceRoot&gt;target/generated-sources&lt;/sourceRoot&gt;
                 &lt;/configuration&gt;
                 &lt;goals&gt;
                   &lt;goal&gt;run&lt;/goal&gt;
                 &lt;/goals&gt;
               &lt;/execution&gt;
             &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>