Problem with integrating multiple projects to eclipse

I have two projects A and B, both dependent on a shared project C. We use submodule of GIT to import the same repository to both of A and B.

Now, we can simply write a build script to build each of them. But there is a problem when we import the projects to eclipse.

We are using the gradle plugin from STS, at first, we import A and C, it works well. Then I import the project B into eclipse, we got a compile error that: "The project was not built due to “Resource ‘/B.C’ does not exist.”. Apparently, we can import only one project “C” int o eclipse and there is already a project “/A.C” which prevent the “/B.C” from importing.

We know that we can create a separated workspace for this issue, but we have too many projects which are in the same structure and we can handle this case by m2eclipse perfectly.

I think that since there are group name and project name in build script, it is not necessary to reference the dependent project by the name prefixed with parent project name.

Is there any workaround with this case?

Are A and B separate Gradle builds? What exactly do you mean by “import the same repository to both of A and B”?

A and B are separate Gradle builds. They are sharing a same project C which is imported as a GIT submodule in a folder.