title: Gradle Sub Projects Builds Are Failed If Sub Projects Contains Same File Name In Same Package Structure
body: <p>Here is my Project structure.</p>
  
  <p><strong>Note:Project-B depends on Project-A Build</strong></p>
  
  <p><a href="https://i.stack.imgur.com/D7KAN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D7KAN.jpg" alt="enter image description here"></a></p>
  
  <p>I have following attributes in SamplePage.Java </p>
  
  <p><strong>Project-A->SamplePage.Java</strong></p>
  
  <pre><code>public string name;
    public int age;
  </code></pre>
  
  <p><strong>Project-B->SamplePage.Java</strong></p>
  
  <pre><code>public string name;
  </code></pre>
  
  <p>I have a <a href="http://www.eclipse.org/xtend/" rel="nofollow noreferrer">Xtend</a> class that will refer Project-B SamplePage.java class and it failed the build throwing <code>The method or field age is undefined for the type SamplePage.java.Execution failed for task ':Project-B:generateXtext'</code>.If i put <code>age</code> attribute to Project-B SamplePage.java it builds successfully.My question is that how can i over come that problem?Not sure if i did some mistake in build script file. </p>
  
  <p><strong>Build.Gradle</strong></p>
  
  <pre><code>allprojects  {
    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'eclipse'
    apply plugin: 'org.xtext.xtend'
  }
  
  subprojects {
    apply plugin: 'java'
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
  
  eclipse {
        project {
          natures 'org.eclipse.xtext.ui.shared.xtextNature'
          buildCommand 'org.eclipse.xtext.ui.shared.xtextBuilder'
        }
      } 
  
  }
  
  etc...
  </code></pre>