title: Gradle cannot find a project in a dependency chain
body: <p>I have 3 Java projects located next to each other in the folder structure: <code>Proj1</code>, <code>Proj2</code> and <code>Proj3</code>. <code>Proj1</code> depends on <code>Proj2</code> and it depends on <code>Proj3</code>.</p>
  
  <p>Here are their <code>settings.gradle</code> files:</p>
  
  <pre><code>rootProject.name = 'Proj3'
  </code></pre>
  
  <hr>
  
  <pre><code>rootProject.name = 'Proj2'
  
  include ':Proj3'
  project(':Proj3').projectDir = new File(settingsDir, '../Proj3')
  </code></pre>
  
  <hr>
  
  <pre><code>rootProject.name = 'Proj1'
  
  include ':Proj2'
  project(':Proj2').projectDir = new File(settingsDir, '../Proj2')
  </code></pre>
  
  <p>and their <code>gradle.build</code> files:</p>
  
  <p>For 2</p>
  
  <pre><code>apply plugin: 'java'
  
  dependencies {
      compile project(':Proj3')
  }
  </code></pre>
  
  <p>For 1</p>
  
  <pre><code>apply plugin: 'java'
  
  dependencies {
      compile project(':Proj2')
  }
  </code></pre>
  
  <p>The 2nd and 3rd projects are built fine by Gradle but when I try to build the 1st it complains that</p>
  
  <blockquote>
    <p>A problem occurred evaluating project ':Proj2:'. Project with path ':Proj3' could not be found in project ':Proj2'.</p>
  </blockquote>
  
  <p>and points to the line <code>compile project(':Proj3')</code> (in the build of <code>Proj2</code>). Stack trace starts with</p>
  
  <blockquote>
    <p>org.gradle.tooling.BuildException: Could not fetch model of type 'EclipseProject' using Gradle distribution '<a href="https://services.gradle.org/distributions/gradle-3.1-bin.zip" rel="nofollow noreferrer">https://services.gradle.org/distributions/gradle-3.1-bin.zip</a>'.</p>
  </blockquote>
  
  <p>Don't know why the 2nd project can find the 3rd fine when it's built and suddenly not when the 1st is built. Why would the 1st care about how the 2nd searches for the 3rd after its already included in the "Project and External Dependencies" folder.</p>
  
  <p>How do I make it work?</p>