Multiple settings.gradle files in a multi-project build

The way it works in maven is that root project will have references to modules directly located under it and not nested submodules/projects. These modules in turn will have references to projects located directly under them.

In gradle only root project of a mutli-project build has a settings.gradle file which references all projects located directly or indirectly under the root project. Adding a project anywhere in the multi-project hierarchy requires modification in settings.gradle file of root project.

A settings.gradle file in each submodule makes sure that only this module is aware of direct submodules/projects under this module which I believe makes things a lot easier when all the projects in a multi-project build are not known in advance.

1 Like