title: Gradle Eclipse not working correctly for subprojects
body: <p>Gradle 2.4 and Eclipse Mars here. Here's my project directory structure:</p>
  
  <pre><code>myapp/  &lt;-- root project
      myapp-client/
          src/main/groovy/*
          build.gradle &lt;-- just declares some client-specific deps
      myapp-shared/
          src/main/groovy/*
          build.gradle &lt;-- shared-specific deps
      myapp-server/
          src/main/groovy/*
          build.gradle &lt;-- server-specific deps and how to package server JAR
      build.gradle
      settings.gradle
  </code></pre>
  
  <p>Where <code>myapp/build.gradle</code> is:</p>
  
  <pre><code>allprojects {
      apply plugin: 'groovy'
      apply plugin: 'eclipse'
      apply plugin: 'maven'
      apply plugin: 'codenarc'
  
      sourceCompatibility = '1.8'
      targetCompatibility = '1.8'
      [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  
      repositories {
          // ...etc.
      }
  
      dependencies {
          // ...etc.
      }
  
      task wrapper(type: Wrapper) {
          gradleVersion = '2.4'
      }
  }
  </code></pre>
  
  <p>And where <code>myapp/settings.gradle</code> is:</p>
  
  <pre><code>include ':myapp-shared'
  include ':myapp-client'
  include ':myapp-server'
  </code></pre>
  
  <p>When I do a <code>./gradlew eclipse</code> I get messages indicating that the command was successful. I then open Eclipse to import <code>myapp</code> as a series of individual subprojects.</p>
  
  <h3>Expectation based on what I'm used to seeing, historically</h3>
  
  <p>In previous projects that contained subprojects, I would go to <code>Import &gt;&gt; Existing Projects into Workspace</code>, where I would see this dialog:</p>
  
  <p><a href="https://i.stack.imgur.com/uTEm5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uTEm5.png" alt="enter image description here"></a></p>
  
  <p>I would then click <code>Browse</code> and select the project root (in this particular case, <code>myapp</code>). Eclipse would then auto-detect the 3 subprojects and populate them as a checked list inside the <em>Projects</em> component in the UI above. I would then click "<em>Finish</em>" and Eclipse would load the 3 subprojects into my workspace, each showing as a separate project (as it should).</p>
  
  <h3>What's actually happening</h3>
  
  <p>Instead, when I click on <code>myapp</code> as the root project, Eclipse just populates it as a single project, almost as if it doesn't detect that I have subprojects at all:</p>
  
  <p><a href="https://i.stack.imgur.com/nJA4b.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nJA4b.png" alt="enter image description here"></a></p>
  
  <p>When I click <em>Finish</em> it imports a single project into my workspace, that has source folders for each of the 3 subprojects. And while that's just an annoyance, the real problem is that the classpath seems to be totally jacked up. For instance, I can add a class to <code>myapp-shared</code>, and then include it in a class defined inside <code>myapp-client</code>, and Eclipse doesn't force me to add an <code>import</code> statement into the client class! It's like the whole project is sharing the same package/namespace.</p>
  
  <p>Can any Gradle gurus spot a defect in my Gradle setup that could be the cause of this?</p>