Custom Eclipse project name

I have many multi projects defining sub projects having the same name.
In order to distinguish them into my Eclipse IDE, I patch their name thanks to a dedicated plugin that was already existing. I use the following syntax

        project.extensions.findByType(EclipseModel).project.with {
            name "${project.parent.name}-${project.name}"
            comment 'Gradle project ' + "${project.parent.name}-${project.name}".toUpperCase() + "${project.description}"
        }

It means in my repository I have defined

  • Proj1
    • Sub1
    • Sub2
  • Proj2
    • Sub1
    • Sub2

But in my Eclipse (after having launch the eclipse task and import projects), I have projects named Proj1-Sub1, Proj1-Sub2, etc. and potential dependencies through project in classpath is correctly handled.

But when I import my project through Eclipse/Import/Existing Gradle project, the buildShip plugin wants to have Eclipse project name having the exact subproject name (Sub1, Sub2).
The sub project directory is displayed as closed in the “Gradle Tasks” view and I cannot run the linked task.

Is it linked to a custom plugin use ? Is it allowed to have an Eclipse project name different from the Gradle name ?

Note : If I run the eclipse task through buildShip, it generates dependencies between subproject using the subproject name, whereas, if launched through a command line, it takes correctly the patch Eclipse name. Does it mean, the buildship plugin doesn’t launch exactly the same target as the same manner ?

Buildship reads most of the properties from EclipseProject. To change the name of the Eclipse project for all subprojects you could include this in the build.gradle of your root project:

subprojects { subproject ->
  eclipse {
    project {
      name "${subproject.parent.name}-${subproject.name}"

      // Buildship currently ignores this setting and sets the comment to "Project <project name> created by Buildship."
      comment 'Gradle project ' + "${subproject.parent.name}-${subproject.name}".toUpperCase() + " ${subproject.description}"
    }
  }
}

Ole O.