Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Buildship Plugin: nesting source folders

I'm using Gradle Buildship plugin in order to build my Eclipse projects.

Gradle itselft is well configured. So, I'm able to build anything from shell.

The gradle project has a root folder and other subprojects.

When I click on Gradle -> Refresh Project it tells me:

Synchronize Gradle builds with workspace failed due to an unexpected error.
Cannot nest 'living_webapi/src/main/java/com/living/persistence/entities' inside 'living_webapi/src/main/java'. To enable the nesting exclude 'com/' from 'living_webapi/src/main/java'
Java Model Exception: Java Model Status [Cannot nest 'living_webapi/src/main/java/com/living/persistence/entities' inside 'living_webapi/src/main/java'. To enable the nesting exclude 'com/' from 'living_webapi/src/main/java']
    at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:786)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3097)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3059)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3112)
    at org.eclipse.buildship.core.workspace.internal.SourceFolderUpdater.updateClasspath(SourceFolderUpdater.java:234)
    at org.eclipse.buildship.core.workspace.internal.SourceFolderUpdater.updateClasspath(SourceFolderUpdater.java:82)
    at org.eclipse.buildship.core.workspace.internal.SourceFolderUpdater.update(SourceFolderUpdater.java:261)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeOpenJavaProject(SynchronizeGradleBuildOperation.java:223)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeOpenWorkspaceProject(SynchronizeGradleBuildOperation.java:213)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeWorkspaceProject(SynchronizeGradleBuildOperation.java:186)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeGradleProjectWithWorkspaceProject(SynchronizeGradleBuildOperation.java:176)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeGradleBuildWithWorkspace(SynchronizeGradleBuildOperation.java:141)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.access$000(SynchronizeGradleBuildOperation.java:106)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation$1.run(SynchronizeGradleBuildOperation.java:123)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5521)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5478)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.run(SynchronizeGradleBuildOperation.java:120)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(SynchronizeGradleBuildsJob.java:78)
    at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.runToolingApiJob(SynchronizeGradleBuildsJob.java:69)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob$1.run(ToolingApiJob.java:73)
    at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:62)
    at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
like image 656
Jordi Avatar asked Sep 13 '16 09:09

Jordi


2 Answers

The only thing that worked for me was un-checking the "Allow output folders for source folders" option.

Steps:

  1. Right click on project -> Properties
  2. Click on Java Build Path in the left side of Properties popup
  3. Click on Source tab
  4. Un-check the "Allow output folders for source folders" checkbox
  5. Click Apply and Close
  6. Right click on project -> Gradle -> Refresh Gradle Project
like image 96
Vladimir Zindovic Avatar answered Sep 22 '22 10:09

Vladimir Zindovic


I got this problem too. My solution is setting project properties.

In Java build Path -> Source,set output folder to default. For more detail,the image below.

Project Properties -> Java build path -> Source

Source folder output location

like image 37
Ziv Avatar answered Sep 20 '22 10:09

Ziv