Skip to main content
Jump to: navigation, search

Tycho/Target Platform

< Tycho
Revision as of 07:01, 12 October 2011 by (Talk | contribs) (First fragment of the page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The target platform is the set of artifacts against which the Tycho resolves the project's dependencies. There are different ways to define the target platform; the most common ones are repositories with layout=p2, which add an entire repository to the target platform, or target definition files for more fine-grained control.

Which approach should I use for the target platform for my project?

Since there are a few different ways to configure a target platform in Tycho, here are some rule of thumbs for the most common cases:

  1. If you are already using a target file in Eclipse, and that target file only contains location elements with type="InstallableUnit", use that target file for the Tycho build. In all other cases, it is not possible to share the target platform configuration between Tycho and Eclipse.
  2. If you don't care about individual bundles and versions, just configure the needed p2 repositories in the POM and have Tycho pick anything required from these repositories.
  3. If you want control over the which bundles/bundle versions are visible to the build, use a target file.

Target platform configuration

The target platform is defined through POM configuration (see details below). Each module has its own target platform, although with the normal configuration inheritance in Maven, the target platform configurations are usually the same across multiple modules. In case multiple configuration approaches are combined (which should be rarely necessary), the target platform contains the union of the content defined in each approach.

Repositories with layout p2

In a standard Maven project, one can configure Maven repositories in the POM from which the dependencies of the project are resolved. While Maven repositories cannot be used directly (see below for an indirect approach), Tycho can use p2 repositories for resolving dependencies. These p2 repositories need to be marked with layout=p2. Example:


With this configuration, Tycho can use any unit (i.e. bundle, feature, etc.) from the specified p2 repositories to resolve the project dependencies. In terms of the target platform, this means that the entire content of the p2 repositories becomes part of the target platform.

Target definition files


Artifacts from Maven repositories


Back to the top