I like to setup a usual multi project build with gradle. The project structure looks like the following:
root/
build.gradle
settings.gradle
share/
build.gradle
domain/
build.gradle
web/
build.gradle
As you might guess, domain depends on share and web depends on share and domain.
There are two ways to descripe this dependenies:
- specify the dependencies for all sub projects in
root/build.gradle
- specify the dependencies per sub project in
root/{sub_project}/build.gradle
I prefer the second option because a project should know its dependencies. Is there anything wrong about this approach? I ask because the most examples found in the internet and in the gradle documentation uses approach 1.