Ola Eldøy
Ola Eldøy

Reputation: 5936

Trying to compile and debug FitNesse in Eclipse, using Gradle

I would like to run FitNesse from Eclipse, so I can debug some issues while developing my "DataFlex Slim Runner". The README on https://github.com/unclebob/fitnesse says:

  1. Clone the FitNesse Git repository from https://github.com/unclebob/fitnesse.
  2. Import FitNesse via File -> Import... -> Gradle Project.
  3. Select the just cloned project folder. Follow the wizard.
  4. Ensure the project properties have a Java 7 compiler or newer set.

Step one is ok, but I am unable to finish steps 2 and 3.

In Eclipse, I select Import Gradle Project. Then I select the project root directory, selecting the just cloned folder. In the Import Options step, I select "Gradle wrapper (recommended)", then "Next". But when clicking "Finish", I get the following error:

Synchronize Gradle builds with workspace failed due to an unexpected error.
Unsupported method: HierarchicalEclipseProject.getIdentifier().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle
you connect to.
Alternatively, you can ignore this exception and read other information from
the model.

org.gradle.tooling.model.UnsupportedMethodException: Unsupported method: HierarchicalEclipseProject.getIdentifier().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
at org.gradle.tooling.model.internal.Exceptions.unsupportedMethod(Exceptions.java:33)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:357)
at com.sun.proxy.$Proxy37.getIdentifier(Unknown Source)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.from(DefaultOmniEclipseProject.java:250)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseProject.from(DefaultOmniEclipseProject.java:246)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultOmniEclipseGradleBuild.from(DefaultOmniEclipseGradleBuild.java:46)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository$8.apply(DefaultSingleBuildModelRepository.java:181)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository$8.apply(DefaultSingleBuildModelRepository.java:177)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeAndWait(BaseModelRepository.java:164)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.access$000(BaseModelRepository.java:41)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository$2.call(BaseModelRepository.java:121)
at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4724)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4721)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.getFromCache(BaseModelRepository.java:138)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:117)
at com.gradleware.tooling.toolingmodel.repository.internal.BaseModelRepository.executeRequest(BaseModelRepository.java:88)
at com.gradleware.tooling.toolingmodel.repository.internal.DefaultSingleBuildModelRepository.fetchEclipseGradleBuild(DefaultSingleBuildModelRepository.java:185)
at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.fetchEclipseGradleBuild(DefaultModelProvider.java:53)
at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(SynchronizeGradleBuildsJob.java:77)
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:61)
at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

What to do???

Upvotes: 1

Views: 876

Answers (3)

greggers
greggers

Reputation: 181

I've just done the same thing as you and initially got the same message.

build.gradle contains the version to use - that got me over the first hurdle (4.3.1 at time of writing).

Then I made sure the latest Buildship version was installed in Eclipse:

Help -> About -> Installation Details -> Update

This did the trick and now I have my project imported!

Upvotes: 0

colo
colo

Reputation: 172

You are trying to import a gradle project built with a version not suppoted in your ide(eclipse), try to rebuild your project with a compatible version from the command line first:

gradle wrapper --gradle-version 3.0

(3.0 is just an example, try to find what version needs your eclipse).

After this step the import process should be ok

Upvotes: 0

Stanislav
Stanislav

Reputation: 28126

You have to change the Gradle distribution you use to make it work. As it's said:

Unsupported method: HierarchicalEclipseProject.getIdentifier()
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.

I don't know, what is your current version, but I can say, that newest Gradle distribution has not this method, you can check it here, but the Gradle version 2.14 has it. So you may try to use this version of Gradle, though I don't know, whether it means to update your Gradle or not.

Update: just had a look into fitnesse build script, it uses Gradle 3.1, not really sure, whether it's possible to change Gradle version to lower. So it seems to me, that you have to deal with Eclipse, may be newer version supports new Gradle distribution, but not really sure. And if you are using buildship then it's 1.0.20 and newer versions should support Gradle 3.1.

Upvotes: 1

Related Questions