简体   繁体   中英

Eclipse 2018-12 has dependency to Windows, Linux and MaxOS

I just updated my application's org.eclipse.e4.rcp feature from Eclipse 4.9. to 4.10 (or 2012-09 to 2012-12). Now I get the exception:

[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].

Both the .target file and the pom.xml have defined the target platform as being for Windows only:

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

And the target file has additionally includeAllPlatforms="false" . If I set it to true, I get the very similar exception:

[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)

If I add the fragments to the target platform, I get the following message (which is completely understandable):

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]

Setting the target platform to planner mode doesn't work. Neither does setting <org.eclipse.swt.buildtime>true</org.eclipse.swt.buildtime> in the pom.xml ( false doesn't work either).

Looking at the XML file of the feature I can't see anything wrong with it (the fragments are defined for their OS only), still the target platform wants to haven the fragments for Linux and MacOS, even though I'm on Windows.

The target platform looks like this (yet again, it works if I replace 2018-12 with 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>

And it's hooked in the pom.xml like this:

        <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>

What is the problem? How can I fix it?

Who would have thought? It's the exact same Eclipse bug as in this question again . For some reason our build process gives preference to the plug-ins in Maven Central over the ones in the Eclipse repository. Since they have broken Maven dependencies, and since Tycho (obviously) still evaluates these dependencies, that breaks the build.

In our case the fix was as easy as moving Maven Central down below the Eclipse repo in our target platform.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM