如果子项目在相同的包结构中包含相同的文件名,则Gradle子项目构建失败

时间:2017-08-03 17:10:49

标签: gradle xtext xtend

这是我的项目结构。

注意:Project-B依赖于Project-A Build

enter image description here

我在SamplePage.Java中有以下属性

项目-A-> SamplePage.Java

public string name;
  public int age;

项目-B-> SamplePage.Java

public string name;

我有一个Xtend类,它将引用Project-B SamplePage.java类,它使构建抛出The method or field age is undefined for the type SamplePage.java.Execution failed for task ':Project-B:generateXtext'失败。如果我将age属性放到Project-B SamplePage.java它成功构建。我的问题是我怎么能解决这个问题呢?不确定我是否在构建脚本文件中犯了一些错误。

的build.gradle

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...

0 个答案:

没有答案