首页 > 解决方案 > Facing issues in multi project build using gradle

问题描述

I have gradle multi-project(Java) build. My project structure is like below:

Root project 'Parent'
+--- Project ':Child1'
+--- Project ':Child2'
\--- Project ':Child3'

Project description: -Child2 is dependent on Child1. -Child3 is dependent on Child1 and Child2.

Each subproject has its own build.gradle file

build.gradle file of Child2 has below content:

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')
}

build.gradle file of Child3 has below content:

    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')
    }

The problem that I am facing is Child1 and Child2 are compiling fine but Child3 is not compiling

标签: javagradle

解决方案


推荐阅读