I'm just getting started with Tycho, attempting to migrate a large RCP product from PDE Build. We have a target platform, defined in a .target file that uses "Software Sites" (p2 repos), and this target works in the developer workspaces. However, I have not been able to get Tycho to recognize and use it to build our plugins, features, and product.
I'm following Lars Vogel's tutorial as well as some Tycho wiki pages and other resources, but none have a complete example of using a .target file to direct Tycho to your target platform. I used the following command to generate pom files in all my plugin, feature, and product projects:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bundles</artifactId>
<groupId>my.group.id</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>designer.target</file>
<type>target</type>
<classifier>designer</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the top-level pom that uses the generated poms and the .target one above that I hand-wrote:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bundles</module>
</modules>
<properties>
<tycho-version>0.16.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<target>
<artifact>
<groupId>my.group.id</groupId>
<artifactId>my.group.id.targetPlatform</artifactId>
<version>2.1.0-SNAPSHOT</version>
<classifier>designer</classifier>
</artifact>
</target>
<environments>
<environment>
<os>${build.os}</os>
<ws>${build.ws}</ws>
<arch>${build.arch}</arch>
</environment>
</environments>
</configuration>
</plugin>
<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>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<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>
</project>
"mvn clean install" starts to build, but quickly complains that it can't resolve basic dependencies from the .target, such as org.eclipse.runtime.core.
[INFO] Computing target platform for MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Resolving dependencies of MavenProject: my.group.id:com.emc.myplugin.ui:1.0.0-SNAPSHOT @ F:\staging\app\bundles\com.emc.myplugin.ui\pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.emc.myplugin.ui 1.0.0.qualifier
[ERROR] Missing requirement: com.emc.myplugin.ui 1.0.0.qualifier requires 'bundle org.eclipse.core.runtime 0.0.0' but it could not be found
The .target file is pretty huge, so I won't paste it here unless someone asks. The gist of it is that it refers to several p2 repos, specifying IUs as well as specific plugin IDs (the "Content" tab of the Target editor in Eclipse IDE).
I've tried using the –X option to mvn in order to get more debugging help, but it didn't yield anything that I found to be useful. Any advice about why Tycho seems to be ignoring the .target file, or how I can further troubleshoot.
Thanks in advance,
Eric