api / org.gradle.plugins.ide.eclipse.model / EclipseProject / setName

setName

open fun setName(name: String): Unit

Configures eclipse project name. It is optional because the task should configure it correctly for you. By default it will try to use the project.name or prefix it with a part of a project.path to make sure the moduleName is unique in the scope of a multi-module build. The 'uniqueness' of a module name is required for correct import into Eclipse and the task will make sure the name is unique.

The logic that makes sure project names are unique is available since 1.0-milestone-2

If your project has problems with unique names it is recommended to always run gradle eclipse from the root, e.g. for all subprojects, including generation of .classpath. If you run the generation of the eclipse project only for a single subproject then you may have different results because the unique names are calculated based on eclipse projects that are involved in the specific build run.

If you update the project names then make sure you run gradle eclipse from the root, e.g. for all subprojects. The reason is that there may be subprojects that depend on the subproject with amended eclipse project name. So you want them to be generated as well because the project dependencies in .classpath need to refer to the amended project name. Basically, for non-trivial projects it is recommended to always run gradle eclipse from the root.

For example see docs for EclipseProject