title: Eclipse Gradle STS Plugin. Add project reference vs dependency management
body: <p>I have Eclipse workspace with 2 projects (let's call them master and slave). I would like to use gradle dependency management for the slave project. Everything works like a charm except link to master project.</p>
  
  <p>STS gradle plugin silently remove link to the master project (according to <a href="https://issuetracker.springsource.com/browse/STS-3082" rel="nofollow">bug STS-3082</a>) after refreshing dependency. I hope that I could somehow instruct gradle to add that link to my class path. I tried just one more src folder, but with no luck.</p>
  
  <p>Any advices are welcome.</p>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>apply plugin: 'eclipse'
  apply plugin: 'java'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile fileTree(dir: 'lib', include: '**/*.jar')
      compile 'org.mockito:mockito-all:1.8.5'
      compile 'org.powermock:powermock-api-mockito:1.4.8'
  }
  
  sourceSets {
      main {
          java {
              srcDir '../Master/src'
              srcDir 'src'
          }
      }
  }
  </code></pre>
  
  <p><strong>.classpath</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" path="src"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/&gt;
      &lt;classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/&gt;
      &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>To fix this issue I have to comment line <code>srcDir '../Master/src'</code> and add to <strong>build.gradle</strong></p>
  
  <pre><code>eclipse.classpath.file.withXml { xml -&gt;
      def node = xml.asNode()
      node.appendNode('classpathentry', [ combineaccessrules: false, exported: true, kind: 'src', path: '/Master' ])
  }
  </code></pre>