# Composite builds and multi-module

**URL:** <https://discuss.gradle.org/t/composite-builds-and-multi-module/20168>\
**Category:** Help/Discuss\
**Created:** [October 25, 2016, 6:25pm UTC](https://discuss.gradle.org/t/composite-builds-and-multi-module/20168 "2016-10-25T18:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![las2k](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@las2k](https://discuss.gradle.org/u/las2k)\
**Post date:** [October 25, 2016, 6:25pm UTC](https://discuss.gradle.org/t/composite-builds-and-multi-module/20168/1 "2016-10-25T18:25:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [October 26, 2016, 8:59am UTC](https://discuss.gradle.org/t/composite-builds-and-multi-module/20168/2 "2016-10-26T08:59:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![las2k](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@las2k](https://discuss.gradle.org/u/las2k)\
**Post date:** [October 26, 2016, 1:02pm UTC](https://discuss.gradle.org/t/composite-builds-and-multi-module/20168/3 "2016-10-26T13:02:50Z")

</div>

## 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’

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [October 26, 2016, 1:06pm UTC](https://discuss.gradle.org/t/composite-builds-and-multi-module/20168/4 "2016-10-26T13:06:03Z")

</div>

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.
