Composite builds and multi-module

I am trying to get composite builds work in a multi-module setup.

child1 and child2 are compile dependent and not compile project dependent. Usually, child1 and child2 are built separately.

Occasionally, i want to build from parent and use composite builds to supply the dependencies.

I tried having a multi-module structure and the children don’t inherit anything from parent and can be built in isolation without parent.

I tried

gradlew --include-build …/child1 :child2:build

I got ‘included build collides with subproject of the same name’ Is there any solution for this problem?

Can you please provide an example on GitHub? From your explanation I can’t yet tell what you are trying to do.

parent
settings.gradle
rootProject.name='parent’
include 'child1’
include ‘child2’

build.gradle
apply plugin ‘java’

child1
dependencies {
compile ‘group:child2:version’ //comes from artifactory
}

child1 and child2 don’t inherit any settings from parent project to be able to build in isolation.

parent project is in place to allow occasional top down builds.

I want to use composite builds like
parent>gradlew --include-build …/child2 child1:build

I am not able to do so as i am getting
’included build collides with subproject of the same name’

You are using include and includeBuild on the same project. You need to pick one. Either child1 is a sub-project (include) or it is a standalone build (includeBuild). It can’t be both.