Build Eclipse cross-platform with Maven Tycho

梦想与她 提交于 2019-12-04 07:58:50

It sounds like you have a plug-in based product. In this case you will need to manually edit your .product file and add in platform filters for these plug-ins. Unfortunately the built-in product editor in eclipse does not expose these values. See http://wiki.eclipse.org/Tycho/FAQ#How_to_build_plugin-based_products_with_platform-specific_fragments.3F

For each plugin e.g. org.eclipse.swt.win32.win32.x86 you will need to add something like;

<plugin id="org.eclipse.swt.win32.win32.x86" fragment="true" ws="win32" os="win32" arch="x86"/>

Note, if you use the product editor it will remove these values.

It is better however to use a feature based product. The feature editor permits these fields to be edited.

There is an easier solution I found in the blog: http://blog.sdruskat.net/building-a-cross-platform-feature-based-eclipse-rcp-product-with-tycho-the-umpteenth/

In the parent/master pom.xml, To use all the plugins from p2, specify the following:

<build>
 <plugins>
  <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-maven-plugin</artifactId>
    <version>${tycho-version}</version>
    <extensions>true</extensions>
  </plugin>

  <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <version>${tycho-version}</version>
    <configuration>
       <resolver>p2</resolver>
        <environments>
          <environment>
            <os>linux</os>
            <ws>gtk</ws>
            <arch>x86_64</arch>
          </environment>
          <environment>
            <os>win32</os>
            <ws>win32</ws>
            <arch>x86_64</arch>
          </environment>
        </environments>
    </configuration>
  </plugin>
 </plugins>
</build>

My tycho version is 0.21.0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!