我有gradle多项目(Java)构建。我的项目结构如下:
Root project 'Parent'
+--- Project ':Child1'
+--- Project ':Child2'
\--- Project ':Child3'
项目描述: -Child2取决于Child1。 -Child3依赖于Child1和Child2。
每个子项目都有自己的build.gradle文件
Child2的build.gradle文件具有以下内容:
apply plugin: 'java'
archivesBaseName = 'xyz'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile fileTree(dir: project.properties['dependency_jar_path'], include: '*.jar')
compile project(':Child1')
}
Child3的build.gradle文件具有以下内容:
apply plugin: 'java'
archivesBaseName = 'abc'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile fileTree(dir: project.properties['dependency_jar_path'], include: '*.jar')
compile project(':Child1')
compile project(':Child2')
}
我面临的问题是Child1和Child2可以正常编译,但是Child3无法编译