I have a project where I would like to create standalone RCP packages for windows, mac, and linux. My product is plugin-based, and there are no differences from the point of view of the project code between the different os/ws targets. I am not currently building a feature.
I am using the tycho-p2-director-plugin and the materialize-products goal. I have downloaded and unzipped the Indigo delta pack and I am using the unzipped directory as a "Profile" location to find bundles/plugins/features etc. The build is creating versions for each platform, which are appearing in target/products, as I expect.
My problem is that the "non-launcher"/"non-equinox" platform-specific bits required by the product - swt bits, security, ui, filesystem - are not being packed with the product versions, and so they will not launch successfully. I see my "splash.bmp", and then the platform quits with an apologetic message box. The logfile shows that the startup cannot locate "SWTError" (NoClassDefFound), and inspection of the version's actual materialized contents shows that the plugins I mentioned are not being included, although the "equinox.launcher" bits for the target os/ws are.
I removed platform-specific dependencies from my Product Definition file (.product), figuring that tycho would be able to figure this out - rather the way Eclipse does when you click "Add Required Plugins" in the .product file editor.
Below are my pom.xml file and my .product file. I have tried variations with .target files, but since I want to build for all platforms it seemed to be another moving piece so I have been consolidating things in the pom.
<?xml version="1.0" encoding="UTF-8"?>
<project
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>.....parent's groupId.....</groupId>
<artifactId>.....parent's artifactId.....</artifactId>
<version>.....parent's version.....</version>
</parent>
<artifactId>......product's artifactID.........</artifactId>
<version>......product's version........</version>
<packaging>eclipse-repository</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<locations>
<location path="${project_loc}/libs" type="Directory"/>
<location path="/usr/share/eclipse-delta-pack/eclipse-3.7.2-delta-pack/eclipse" type="Profile"/>
</locations>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<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>macosx</os>
<ws>cocoa</ws>
<arch>x86</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>....the "defining plugin"'s groupId.....</groupId>
<artifactId>....the "defining plugin"'s artifactId.....</artifactId>
<version>....the "defining plugin"'s version.....</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="MonkeyTalkIDE" uid="MonkeyTalkIDE" id="com.gorillalogic.monkeytalk.ide.product" application="org.eclipse.ui.ide.workbench" version="1.0.3.beta1" useFeatures="false" includeLaunchers="true">
<aboutInfo>
<image path="icons/branding/MyBranding_ICON_184.png"/>
<text>
My Product
Copyright 2012 Gorilla Logic, Inc.
</text>
</aboutInfo>
<configIni use="default">
</configIni>
<launcherArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
<windowImages i16="icons/branding/MyBranding_ICON_16.png" i32="icons/branding/MyBranding_ICON_32.png" i48="icons/branding/MyBranding_ICON_48.png" i64="icons/branding/MyBranding_ICON_64.png" i128="icons/branding/MyBranding_ICON_128.png"/>
<splash
location=".....defining plugin's id......" />
<launcher name="MyProductName">
<macosx icon="icons/branding/MyBranding.icns"/>
<solaris/>
<win useIco="false">
<bmp
winSmallHigh="icons/branding/MyBranding_ICON_16.bmp"
winMediumHigh="icons/branding/MyBranding_ICON_32.bmp"
winLargeHigh="icons/branding/MyBranding_ICON_48.bmp"/>
</win>
</launcher>
<vm>
</vm>
<license>
<text>
MyProduct is licensed under the terms of the GNU General Public License version 3.0
</text>
</license>
<plugins>
<plugin id="......defining plugin's id......."/>
<plugin id="com.ibm.icu"/>
<plugin id="javax.servlet"/>
<plugin id="javax.transaction" fragment="true"/>
<plugin id="org.eclipse.ant.core"/>
<plugin id="org.eclipse.compare"/>
<plugin id="org.eclipse.compare.core"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.databinding"/>
<plugin id="org.eclipse.core.databinding.observable"/>
<plugin id="org.eclipse.core.databinding.property"/>
<plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filebuffers"/>
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.auth"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
<plugin id="org.eclipse.core.variables"/>
<plugin id="org.eclipse.debug.core"/>
<plugin id="org.eclipse.debug.ui"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.frameworkadmin"/>
<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
<plugin id="org.eclipse.equinox.p2.core"/>
<plugin id="org.eclipse.equinox.p2.engine"/>
<plugin id="org.eclipse.equinox.p2.metadata"/>
<plugin id="org.eclipse.equinox.p2.metadata.repository"/>
<plugin id="org.eclipse.equinox.p2.repository"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.equinox.security"/>
<plugin id="org.eclipse.equinox.simpleconfigurator"/>
<plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
<plugin id="org.eclipse.equinox.weaving.hook" fragment="true"/>
<plugin id="org.eclipse.help"/>
<plugin id="org.eclipse.jdt.compiler.apt" fragment="true"/>
<plugin id="org.eclipse.jdt.compiler.tool" fragment="true"/>
<plugin id="org.eclipse.jdt.core"/>
<plugin id="org.eclipse.jdt.core.manipulation"/>
<plugin id="org.eclipse.jdt.debug"/>
<plugin id="org.eclipse.jdt.debug.ui"/>
<plugin id="org.eclipse.jdt.junit"/>
<plugin id="org.eclipse.jdt.junit.core"/>
<plugin id="org.eclipse.jdt.junit.runtime"/>
<plugin id="org.eclipse.jdt.junit4.runtime"/>
<plugin id="org.eclipse.jdt.launching"/>
<plugin id="org.eclipse.jdt.ui"/>
<plugin id="org.eclipse.jface"/>
<plugin id="org.eclipse.jface.databinding"/>
<plugin id="org.eclipse.jface.text"/>
<plugin id="org.eclipse.ltk.core.refactoring"/>
<plugin id="org.eclipse.ltk.ui.refactoring"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
<plugin id="org.eclipse.search"/>
<plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.team.core"/>
<plugin id="org.eclipse.team.ui"/>
<plugin id="org.eclipse.text"/>
<plugin id="org.eclipse.ui"/>
<plugin id="org.eclipse.ui.console"/>
<plugin id="org.eclipse.ui.editors"/>
<plugin id="org.eclipse.ui.forms"/>
<plugin id="org.eclipse.ui.ide"/>
<plugin id="org.eclipse.ui.ide.application"/>
<plugin id="org.eclipse.ui.intro"/>
<plugin id="org.eclipse.ui.intro.universal"/>
<plugin id="org.eclipse.ui.navigator"/>
<plugin id="org.eclipse.ui.navigator.resources"/>
<plugin id="org.eclipse.ui.views"/>
<plugin id="org.eclipse.ui.views.properties.tabbed"/>
<plugin id="org.eclipse.ui.workbench"/>
<plugin id="org.eclipse.ui.workbench.texteditor"/>
<plugin id="org.eclipse.wst.jsdt.core"/>
<plugin id="org.eclipse.wst.jsdt.manipulation"/>
<plugin id="org.eclipse.wst.jsdt.ui"/>
<plugin id="org.hamcrest.core"/>
<plugin id="org.junit"/>
</plugins>
<configurations>
<plugin id=".....defining plugin's id......" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
</configurations>
</product>