Cannot include existing Eclipse project

Hi,

Previously, we had two separate places in our Gradle hierarchy with the same name “customactions” (which created an implicit project in Gradle).

I renamed the path of one set of these projects in gradle to be unique, and the problem went away. Howver, recently, developers have noticed the following error, even though we don’t appear to load the same project name twice.
!ENTRY org.eclipse.buildship.core 4 0 2015-10-28 14:36:19.678
!MESSAGE Synchronize workspace projects with Gradle counterparts failed due to an error configuring Eclipse.
!STACK 0
org.eclipse.buildship.core.GradlePluginsRuntimeException: Cannot include existing Eclipse project customactions.
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceOperations.includeProject(DefaultWorkspaceOperations.java:196)
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceGradleOperations.addExistingEclipseProjectToWorkspace(DefaultWorkspaceGradleOperations.java:205)
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceGradleOperations.synchronizeNonWorkspaceProject(DefaultWorkspaceGradleOperations.java:187)
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceGradleOperations.synchronizeGradleProjectWithWorkspaceProject(DefaultWorkspaceGradleOperations.java:109)
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceGradleOperations.synchronizeGradleBuildWithWorkspace(DefaultWorkspaceGradleOperations.java:70)
at org.eclipse.buildship.core.workspace.SynchronizeGradleProjectJob.runToolingApiJobInWorkspace(SynchronizeGradleProjectJob.java:71)
at org.eclipse.buildship.core.util.progress.ToolingApiWorkspaceJob$1.run(ToolingApiWorkspaceJob.java:74)
at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:61)
at org.eclipse.buildship.core.util.progress.ToolingApiWorkspaceJob.runInWorkspace(ToolingApiWorkspaceJob.java:71)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.IllegalStateException: Workspace already contains a project with name customactions.
at com.google.common.base.Preconditions.checkState(Preconditions.java:150)
at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceOperations.includeProject(DefaultWorkspaceOperations.java:176)
… 10 more

This appears only to happen if I load another Gradle project in the same workspace, yet, the second gradle project doesn’t contain ‘customactions’, so it is odd.

Mark

We are aware of this, if you want to track the updates on this story you can subscribe to the corresponding Bugzilla entry.

Thank you for the report anyway, it’s always nice to get feedback from the users and see their concerns.

I didn’t realize this was related to that ticket. in my case, the ‘customactions’ project only existed in one of the imported projects.

Please ignore my previous comment, I understand the problem now. Could you please provide a small sample project what I can use to reproduce the issue?

I will boil it down to the simplest possible example.