How to configure Gradle module name in InteliJ IDEA

451 Views Asked by At

I have project with numerous of submodules located in different directories:

enter image description here

How you can see, the module name of IDEA (in []) differs from directory root. I've tried to modify it though Project Settings, but after gradle sync it returns to initial state.

Is it possible to configure Gradle to set module name according with directory name?

1

There are 1 best solutions below

1
Andrey On

IDE takes the module name from the Gradle configuration, which is by default a project directory name. If you want to change it you can do so by adding the following in the settings.gradle file:

rootProject.name = 'newProjectName'

See also the Naming recommendations from Gradle.