在build.gradle文件中添加以下代码,将Buildship的Eclipse类路径设置为Eclipse本身的类路径,而不是生成的lib子项目。
eclipse.classpath.downloadSources=true
eclipse.classpath.plusConfigurations += [ configurations.compile ]
eclipse.classpath.file {
beforeMerged { classpath ->
classpath.entries.removeAll {
it.kind == 'lib' && it.path.contains('/buildship/')
}
}
}