尝试使用Gradle在Eclipse中编译和调试FitNesse

时间:2016-12-09 06:39:49

标签: eclipse gradle fitnesse

我想从Eclipse运行FitNesse,所以我可以在开发“DataFlex Slim Runner”时调试一些问题。 https://github.com/unclebob/fitnesse上的自述文件说:

  1. https://github.com/unclebob/fitnesse克隆FitNesse Git存储库。
  2. 通过文件导入FitNesse - >导入... - > Gradle项目。
  3. 选择刚刚克隆的项目文件夹。按照向导。
  4. 确保项目属性具有Java 7编译器或更新版本。
  5. 第一步没问题,但我无法完成第2步和第3步。

    在Eclipse中,我选择Import Gradle Project。然后我选择项目根目录,选择刚刚克隆的文件夹。在“导入选项”步骤中,选择“Gradle wrapper(推荐)”,然后选择“Next”。但是当点击“完成”时,我收到以下错误:

    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)
    

    怎么做???

3 个答案:

答案 0 :(得分:1)

您必须更改用于使其工作的Gradle分布。正如它所说:

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.

我不知道你现在的版本是什么,但我可以说,最新的Gradle发行版没有这种方法,你可以查看它here,但Gradle版本2.14 {{3} }。因此,您可以尝试使用此版本的Gradle,但我不知道是否意味着更新您的Gradle。

更新:刚看了一下fitnesse构建脚本,它使用了Gradle 3.1,不太确定,是否可以将Gradle版本更改为更低版本。所以在我看来,你必须处理Eclipse,可能是较新的版本支持新的Gradle分发,但不是很确定。如果您使用的是has it,那么它的1.0.20和更新的版本应该支持Gradle 3.1。

答案 1 :(得分:0)

您正在尝试导入使用您的ide(eclipse)中未支持的版本构建的gradle项目,尝试首先从命令行使用兼容版本重建项目:

gradle wrapper --gradle-version 3.0

(3.0只是一个例子,试着找出你的日食需要什么版本。)

在此步骤之后,导入过程应该没问题

答案 2 :(得分:0)

我刚刚和你做了同样的事情,并且最初得到了同样的信息。

build.gradle包含要使用的版本 - 这让我超越了第一个障碍(撰写本文时为4.3.1)。

然后我确保在Eclipse中安装了最新的Buildship版本:

帮助 - >关于 - >安装细节 - >更新

这就是诀窍,现在我导入了我的项目!