0

我刚刚org.eclipse.e4.rcp从 Eclipse 4.9 更新了我的应用程序的功能。至 4.10(或 2012-09 至 2012-12)。现在我得到了例外:

[ERROR] Cannot resolve target definition:
[ERROR]   Problems resolving provisioning plan.:
[ERROR]      Unable to satisfy dependency from org.eclipse.swt 3.109.0.v20181204-1801 to org.eclipse.equinox.p2.iu; org.eclipse.swt.gtk.linux.x86_64 [3.109.0.v20181204-1801,3.109.0.v20181204-1801].
[ERROR]      Unable to satisfy dependency from org.eclipse.swt 3.109.0.v20181204-1801 to org.eclipse.equinox.p2.iu; org.eclipse.swt.cocoa.macosx.x86_64 [3.109.0.v20181204-1801,3.109.0.v20181204-1801].
[ERROR]      Unable to satisfy dependency from org.eclipse.swt 3.109.0.v20181204-1801 to org.eclipse.equinox.p2.iu; org.eclipse.swt.gtk.linux.ppc64le [3.109.0.v20181204-1801,3.109.0.v20181204-1801].

.target文件和pom.xml都将目标平台定义为仅适用于 Windows:

<environment>
    <os>win32</os>
    <ws>win32</ws>
    <arch>x86_64</arch>
</environment>

并且目标文件还有includeAllPlatforms="false". 如果我将其设置为 true,我会得到非常相似的异常:

[ERROR]   Software being installed: org.acme.plugin 7.0.0.qualifier
[ERROR]   Missing requirement: org.eclipse.swt 3.109.0.v20181204-1801 requires 'org.eclipse.equinox.p2.iu; org.eclipse.swt.gtk.linux.x86_64 [3.109.0.v20181204-1801,3.109.0.v20181204-1801]' but it could not be found
[ERROR]   Cannot satisfy dependency: org.acme.plugin 7.0.0.qualifier depends on: java.package; org.eclipse.jface.preference 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.jface 3.15.0.v20181123-1505 depends on: osgi.bundle; org.eclipse.swt [3.104.0,4.0.0)

如果我将片段添加到目标平台,我会收到以下消息(这是完全可以理解的):

org.eclipse.swt.gtk.linux.x86_64 3.109.0.v20181204-1801 cannot be installed in this environment because its filter is not applicable. -> [Help 1]

将目标平台设置为planner模式不起作用。pom.xml<org.eclipse.swt.buildtime>true</org.eclipse.swt.buildtime>中的设置也不起作用 (也不起作用)。false

查看该功能的 XML 文件,我看不出它有什么问题(片段仅为他们的操作系统定义),即使我在 Windows 上,目标平台仍然希望拥有 Linux 和 MacOS 的片段。

目标平台看起来像这样(同样,如果我将 2018-12 替换为 2018-09,它仍然有效):

<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
  <repository location="https://download.eclipse.org/releases/2018-12/"/>

    <unit id="org.eclipse.e4.rcp.feature.group"                     version="0.0.0" />
    <unit id="org.eclipse.emf.common.feature.group"                 version="0.0.0" />
    <unit id="org.eclipse.emf.ecore.feature.group"                  version="0.0.0" />
    <unit id="org.eclipse.equinox.executable.feature.group"         version="0.0.0" />
    <unit id="org.eclipse.rcp.feature.group"                        version="0.0.0" />
</location>

它像这样挂在pom.xml中:

        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <configuration>
                <resolver>p2</resolver>
                <target>
                    <artifact>
                        <groupId>groupId</groupId>
                        <artifactId>org.acme.plugin.build</artifactId>
                        <version>7.0.0-SNAPSHOT</version>
                        <classifier>platform</classifier>
                    </artifact>
                </target>
                <ignoreTychoRepositories>true</ignoreTychoRepositories>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>

问题是什么?我该如何解决?

4

1 回答 1

1

谁曾想到?这又与这个问题中的 Eclipse 错误完全相同。出于某种原因,我们的构建过程优先考虑 Maven Central 中的插件而不是 Eclipse 存储库中的插件。由于它们破坏了 Maven 依赖关系,并且由于 Tycho(显然)仍在评估这些依赖关系,因此破坏了构建。

在我们的案例中,修复就像将 Maven Central 移到目标平台中的 Eclipse 存储库下方一样简单。

于 2019-02-14T07:46:25.433 回答