Eclipse PDE Ant 构建脚本生成由于二进制循环而失败

发布于 2024-08-06 06:44:20 字数 930 浏览 2 评论 0原文

我正在尝试使用 Eclipse PDE 工具将一组插件(最终是 OSGi 包)编译成一个功能。我有一个基于 Spring 框架的自定义目标平台。

当我通过 Eclipse 的导出向导导出该功能时,该功能会成功构建,但是,当我尝试从 feature.xml 文件生成 Ant 构建脚本时,我会收到有关“周期”的错误。经过一些研究,我发现导出向导中有一个“允许目标平台中的二进制循环”复选框 - 取消选中它会产生与尝试使用 PDE 工具生成 Ant 构建文件时看到的相同结果。

我尝试从导出向导中保存 Ant 构建文件,但是当我执行 Ant 构建文件时,我收到相同的错误,表明存在循环(并且它引用目标平台包)。

此外,我尝试在 build.properties 文件中设置“allowBinaryCycles = true”,并将其设置为 Ant Build 脚本的属性 - 两者都没有影响结果。

如何运行从导出向导生成的 Ant 构建文件,以便在目标平台中允许二进制循环?

编辑: 需要明确的是,这里的错误存在于目标平台(即:Spring 框架!)中。事实证明,Spring 框架中的 Context 和 ORM 包之间存在一个循环。这有点烦人,并且存在两个不错的解决方法:

  1. 如果不需要 ORM 包,则排除它(事实证明这是我最好的解决方案)
  2. 从 ORM 包中删除对 Context 包的动态依赖。

Spring 论坛上的一些讨论有助于解决此问题。

当然,这些解决方案是 Spring 特有的。似乎还有第二个问题——这次是 Eclipse 作为构建器——允许这些二进制循环的选项(无论它们可能是错误和糟糕的)仅存在于构建器的 GUI 版本中。人们希望最终这个选项能够进入 Ant 构建任务。

I'm trying to compile down a set of plug-ins (ultimately OSGi bundles) into a feature using Eclipse PDE tools. I have a custom Target Platform based on the Spring framework.

When I export the feature through Eclipse's Export Wizard the feature builds successfully, however, when I try to generate an Ant build script from the feature.xml file I receive an error about "cycles". After doing some research, I found out there's an "Allow for binary cycles in target platform" checkbox in the Export Wizard -- unchecking it produces the same result I see when trying to use PDE tools to generate the Ant build file.

I've tried saving the Ant build file from the Export Wizard, but when I execute the Ant build file I receive the same error indicating a cycle exists (and it references the target platform bundles).

Additionally, I've tried setting "allowBinaryCycles = true" in the build.properties file and also as a property on the Ant Build script -- neither affected the result.

How do I run the generated Ant build file from the Export Wizard such that binary cycles are allowed in the target platform?

Edit:
To be clear, the error here exists within the Target Platform (ie: the Spring Framework!). It turns out a cycle exists in Spring Framework between the Context and ORM bundles. This is somewhat annoying, and two decent workarounds exist:

  1. Exclude the ORM bundle if it's unneeded (turns out this was my best solution)
  2. Remove the dynamic dependency on the Context bundle from the ORM bundle.

Some discussion on the Spring Forums assisted in resolving this issue.

These solutions are particular to Spring, of course. There seems to be a second issue -- this time with Eclipse as a builder -- that the option to allow these binary cycles (however wrong and awful they may be) only exists in the GUI version of the builder. One would hope that eventually this option will make its way into the Ant build tasks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

耳根太软 2024-08-13 06:44:20

解决起来通常很痛苦,但循环是一种代码味道,如果可能的话,您应该删除它们而不是绕过它们。从长远来看,你会节省精力。

一种巧妙的解决方法是从插件的依赖项构建 复合类路径,然后一次性编译所有类。将生成的类添加到路径中并依次构建每个插件。

It's often painful to resolve, but cycles are a code smell, if possible you should remove them rather than work round them. You'll save effort in the long term.

A hacky workaround would be to build a composite classpath from the plugins' dependencies, then compile all classes in one go. Add the resultant classes to the path and build each plugin in turn.

许久 2024-08-13 06:44:20

事实证明,Spring 框架中的 Context 和 ORM 包之间存在一个循环。这有点烦人,并且存在两个不错的解决方法:

  1. 如果不需要 ORM 包,则排除它(事实证明这是我最好的解决方案)
  2. 从 ORM 包中删除对 Context 包的动态依赖。

Spring 论坛上的一些讨论有助于解决此问题。

当然,这些解决方案是 Spring 特有的。似乎还有第二个问题——这次是 Eclipse 作为构建器——允许这些二进制循环的选项(无论它们可能是错误和糟糕的)仅存在于构建器的 GUI 版本中。人们希望最终这个选项能够进入 Ant 构建任务。

It turns out a cycle exists in Spring Framework between the Context and ORM bundles. This is somewhat annoying, and two decent workarounds exist:

  1. Exclude the ORM bundle if it's unneeded (turns out this was my best solution)
  2. Remove the dynamic dependency on the Context bundle from the ORM bundle.

Some discussion on the Spring Forums assisted in resolving this issue.

These solutions are particular to Spring, of course. There seems to be a second issue -- this time with Eclipse as a builder -- that the option to allow these binary cycles (however wrong and awful they may be) only exists in the GUI version of the builder. One would hope that eventually this option will make its way into the Ant build tasks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文