Gradle – Multi-Modul-Project – Change module path

In Multi-Modul-Projects you have several options to define the directory structure.

One variant, we also use for our projects, is the following: 

The simplest and fastest solution with Gradle is to define the following includes in the settings settings.gradle  file:

This solution has, at least, to drawbacks. One is that you need to define inter-module dependencies in that way project(‘modules:module_k’). The other one is, that you need to use a prefix like this modules:module_k if you would like to start a specific task of one of the submodules.

With Gradle you can change the path for you subprojects:

This has the advantage, that you can directly specify the module for tasks and depdencies.

Info: Projectpaths can only be changed in the settings.gradle file, in the usual build script this property is write only.

 
0 Kudos
Don't
move!

Leave a Reply

Your email address will not be published. Required fields are marked *