-
Notifications
You must be signed in to change notification settings - Fork 108
Error importing projects - Build Model: InconsistenProjectHierarchyException #59
Comments
Hmm... that worked just fine for me... Check if the Gradle eclipse integration plugins in your Plug-in Registry view are these: and also check if these are the ones that become active when you attempt to import your model. Did you upgrade to Gradle 3.6.2 or installed STS 3.6.2 and then added Gradle to fresh installation of STS? |
I have version 3.6.2.201410090835-RELEASE of the plug-ins. Looking at the installation history, I started with regular eclipse Java EE 4.4 and installed Gradle IDE 3.5.1.201404300713-RELEASE. I got eclipse updated, and Gradle IDE 3.6.0.201407080553-RELEASE, and finally 3.6.2.201410090835-RELEASE. |
When you import the Gradle project into Eclipse, I assume you follow the import wizard, select Gradle Project and then find the folder on your file system where the Collections projects hierarchy is located. Once that is done you click on the "Build Model" button and then the exception occurs? |
Yes, import gradle project, when I press build model I got an error saying to look at the log. The exception was copy-pasted from the .log file. (Edit: Yes, it happens 100% of the time) Since it worked for you, I just started with a clean install Eclipse Luna SR1, installed gradle plugin 3.62, new workspace with new git clone... And now it works. Maybe some problem in the upgrade process? |
We do get some issues on Gradle that occurred after upgrading Eclipse and Gradle eclipse plugin, but couldn’t pinpoint what exactly is going wrong… Every time it’s something different and very weird that has been tested before the release…
|
Got it again... For some reason Gradle -> Refresh All was not working. So, I decided to remove the projects from the workspace and import them again, to see if it helps. Now, it won't import it again... !ENTRY org.springsource.ide.eclipse.gradle.core 4 0 2014-11-15 12:25:07.941 !MESSAGE Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections' !STACK 0 java.lang.reflect.InvocationTargetException at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:113) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) Caused by: org.springsource.ide.eclipse.gradle.core.InconsistenProjectHierarchyException: Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections' at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.inconsistentProjectHierachy(ExceptionUtil.java:82) at org.springsource.ide.eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.getCachedModel(GradleModelProvider.java:339) at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:634) at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:653) at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:516) at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:105) ... 1 more Root exception: org.springsource.ide.eclipse.gradle.core.InconsistenProjectHierarchyException: Gradle project hierarchy is inconsistent for '/home/ralmeida/workspace-collections/Collections' at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.inconsistentProjectHierachy(ExceptionUtil.java:82) at org.springsource.ide.eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.getCachedModel(GradleModelProvider.java:339) at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:634) at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:653) at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:516) at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:105) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) |
The error means that gradle tooling is having problem creating a tooling api model for a project via its root project. This happens when some stored information in the project preference area links a given project to a root project, but when building a model for the root project then it can not find the project as a descendant of the root project. Maybe the project hierarchy changed? Or maybe there is some problem in your settings.gradle defining sub-projects for your root project. Before importing the project try maybe deleting the settings files in the .settings/gradle folder (this is where the information is stored). I suggest you try to delete all these .settings/gradle files in all your projects and then try importing them again. |
This problem comes when the local version and project which has version.is different. Basically every project has on task in build.gradle file called wrapper. This wraaper defines which version of gradle had been used in this project which is in gradle.properties. Advice better to use same version by looking into gradle.properites file or use the project provided gradlew command which is going to download a gradle version required by project. |
I have a project with sub-projects (https://github.com/i23098/Collections) that compiles correctly on the command-line. When I try to import the project in Eclipse I get an error and tells me to check the log... Checking it, it has:
Eclipse IDE for Java EE Developers 4.4.1.20140925-1820
Gradle IDE 3.6.2.201410090835-RELEASE (configured to use gradle wrapper at http://services.gradle.org/distributions/gradle-2.1-bin.zip)
The text was updated successfully, but these errors were encountered: