首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Tycho P2存储库切换到Eclipse文件

从Tycho P2存储库切换到Eclipse文件
EN

Stack Overflow用户
提问于 2021-05-20 11:52:47
回答 1查看 330关注 0票数 2

我想将基于Eclipse露娜的Eclipse项目从“POM中的P2存储库”-approach切换到目标文件方法。(从Tycho文档中的方法2到Tycho文档)。这看起来很简单,但并不是因为我需要支持多个环境。

所以在我以前的父母里我有:

代码语言:javascript
复制
<repositories>
    <repository>
        <id>eclipse platform</id>
        <url>https://my-domain/nexus/repository/eclipse_luna_repo/</url>
        <layout>p2</layout>
    </repository>
    <repository>
        <id>e4 tools</id>
        <url>https://my-domain/nexus/repository/e4_tools/</url>
        <layout>p2</layout>
    </repository>
</repositories>

还包括:

代码语言:javascript
复制
<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <version>${tycho.version}</version>
    <configuration>
        <resolver>p2</resolver>
        <environments>
            <environment>
                <os>win32</os>
                <ws>win32</ws>
                <arch>x86</arch>
            </environment>
            <environment>
                <os>win32</os>
                <ws>win32</ws>
                <arch>x86_64</arch>
            </environment>
            <environment>
                <os>linux</os>
                <ws>gtk</ws>
                <arch>x86_64</arch>
            </environment>
        </environments>
    </configuration>
</plugin>

这足以将目标平台定义为Tycho,然后从不同的插件定义中选择所需的依赖项。

如何获得等效的目标文件?

到目前为止,我的尝试如下(用目标平台DSL转换):

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1621516437">
  <locations>
    <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
      <unit id="org.eclipse.platform.feature.group" version="4.4.2.v20150204-1700"/>
      <unit id="org.eclipse.rcp.feature.group" version="4.4.2.v20150204-1700"/>
      <unit id="org.eclipse.jdt.feature.group" version="3.10.1.v20150204-1700"/>
      <unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.200.v20140512-1802"/>
      <unit id="org.eclipse.equinox.executable.feature.group" version="3.6.102.v20150204-1316"/>
      <unit id="org.eclipse.ui" version="3.106.1.v20141002-1150"/>
      <unit id="org.eclipse.core.filesystem.linux.x86_64" version="1.2.200.v20140124-1940"/>
      <unit id="org.eclipse.core.filesystem.win32.x86" version="1.4.0.v20140124-1940"/>
      <unit id="org.eclipse.core.net.linux.x86_64" version="1.1.100.v20140124-2013"/>
      <unit id="org.eclipse.core.net.win32.x86" version="1.0.100.v20140124-2013"/>
      <unit id="org.eclipse.equinox.security.win32.x86" version="1.0.300.v20130327-1442"/>
      <unit id="org.eclipse.swt.gtk.linux.x86_64" version="3.103.2.v20150203-1351"/>
      <unit id="org.eclipse.swt.win32.win32.x86" version="3.103.2.v20150203-1351"/>
      <repository id="eclipse-luna" location="https://my-domain/nexus/repository/eclipse_luna_repo"/>
    </location>
    <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
      <unit id="org.eclipse.e4.tools.compat" version="0.12.0.v20141113-1753"/>
      <unit id="org.eclipse.e4.tools.services" version="0.12.0.v20141120-0900"/>
      <repository id="e4_luna_tools" location="https://my-domain/nexus/repository/e4_tools"/>
    </location>
  </locations>
</target>

但是,当我使用Tycho构建时,我得到了以下例外:

org.eclipse.core.filesystem.linux.x86_64 1.2.200.v20140124-1940 cannot be installed in this environment because its filter is not applicable.

我认为有两种解决办法:

  • 为每个环境使用目标文件( )
    • 但这似乎是一项艰巨的工作,我必须为每个环境建立完整的环境。
    • 至少中间步骤起作用了。仅限于win32 win32 x86_64,Eclipse可以启动我的程序,Tycho可以构建它。

  • 将P2存储库中的每个插件放在目标文件中,并使用includeMode="slicer"includeAllPlatforms="true"
    • 这似乎无法工作,因为某些PowerPC依赖项无法解决。我不使用PowerPC架构。

此外,这可能是一个重复的问题:多操作系统的特性,但由于它已经四岁,没有答案,我想我会再试一次……

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-21 07:47:32

与平台相关的安装单元(如org.eclipse.core.filesystem.linux.x86_64org.eclipse.core.filesystem.win32.x86等)不同,您应该添加包含平台依赖单元的安装单元作为子单元(带有特定于平台的过滤器)。

对于您的第一个<location>,使用以下三个单元而不是所有的单元(至少那才是对我有用的):

代码语言:javascript
复制
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67619806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档