Build Eclipse Cross Platform with Maven Tycho

I am trying to compile an Eclipse Indigo RCP application with Maven and Tycho . It works great if I just create it for one platform, but if I try to build it for more build stops, it works.

The problem is that I have platform-specific plugins in my product file that I want to build. Dependencies such as org.eclipse.swt.win32.win32.x86 , which are snippets for org.eclipse.swt .
When I add any fragments for a specific platform for my product, the application does not start, because there are no platform libraries such as org.eclipse.swt.win32.win32.x86. As a Tycho repository, we use a clone of the indigo eclipse update site hosted on our own server. It includes a delta package. And when I add all fragments for all platforms, assembly failure and maven tell me that the platform filters do not match the Linux assembly, for example.

Does anyone know how to fix this? Should I add these platform-specific materials to my product? I prefer to keep certain dependencies from my product, right?

+6
source share
2 answers

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

For each plugin, for example. org.eclipse.swt.win32.win32.x86 you 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 delete these values.

However, it is better to use a performance-based product. The function editor allows you to edit these fields.

+7
source

The blog has an easier solution: 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

+1
source

All Articles