target-platform-configuration:target-platform-configuration

Full name:

org.eclipse.tycho:target-platform-configuration:2.6.0-SNAPSHOT:target-platform-configuration

Description:

Configures the target-platform to use in order to resolve dependencies.
⚠️ This mojo is actually not executable, and is only meant to host configuration

Attributes:

  • Requires a Maven project to be executed.

Optional Parameters

Name Type Since Description
<allowConflictingDependencies> boolean - (no description)
Default value is: false.
<breeHeaderSelectionPolicy> TargetPlatformConfiguration$BREEHeaderSelectionPolicy - (no description)
<dependency-resolution> Object - Configure dependency resolution, for example by adding requirements. Example:
<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <configuration>
    <dependency-resolution>
      <extraRequirements>
        <requirement>
          <type>eclipse-feature</type>
          <id>example.project.feature</id>
          <versionRange>0.0.0</versionRange>
        </requirement>
      </extraRequirements>
    </dependency-resolution>
  </configuration>
 </plugin>

<environments> TargetEnvironment[] - Target environments (os/ws/arch) to consider.
<executionEnvironment> String - Force an execution environment for dependency resolution. If unset, the first targetJRE available in target is used.

Set to none to force the resolution to happen without any execution environment, typically when the module is supposed to use system packages coming from some dependencies (eg shipping a JRE inside products with Eclipse JustJ).


<executionEnvironmentDefault> String - (no description)
<filters> List - Selectively remove content from the target platform.

This for example allows to restrict the version of a bundle, or to select one particular provider for a package. Filtering is done as last step in the target platform computation, so the filters apply to all sources listed above.

The filters will only remove content from the target platform; they will not add new content. dependency-resolution should be used for addition of extra content. If you specify a restriction that is not fulfilled by any of the units from the target platform sources, all units that the filter applies to (i.e. units that match the filter.type, filter.id, and filter.version/versionRange criteria) will be removed from the target platform.

Package provider restrictions work by removing all other bundles exporting the package. This means that these other bundles (and the packages only exported by them) won't be available in your build.

Example:

<plugin> <groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version> <configuration> <filters>

<!-- example 1: restrict version of a bundle --> <filter>
<type>eclipse-plugin</type> <id>org.eclipse.osgi</id> <restrictTo>
<versionRange>[3.6,3.7)</versionRange> <!-- alternative: <version> for selecting
exactly one versions --> </restrictTo> </filter>

<!-- example 2: remove all providers of the package javax.persistence except the bundle
javax.persistence --> <filter> <type>java-package</type>
<id>javax.persistence</id> <restrictTo> <type>eclipse-plugin</type>
<id>javax.persistence</id> </restrictTo> </filter>

<!-- example 3: work around Equinox bug 348045 --> <filter>
<type>p2-installable-unit</type>
<id>org.eclipse.equinox.servletbridge.extensionbundle</id> <removeAll />
</filter> </filters> </configuration> </plugin>

<pre>

<includePackedArtifacts> boolean - (no description)
<pomDependencies> TargetPlatformConfiguration$PomDependencies - Defines which strategy to apply to Maven dependencies.

If consider or wrapAsBundle, the effect is:

  • First, Maven resolves the GAV dependencies according to the normal Maven rules. This results in a list of artifacts consisting of the specified artifacts and their transitive Maven dependencies.
  • Tycho then checks each of these artifacts, and if the artifact is an OSGi bundle, it is added to the target platform. Other artifacts are ignored in case of consider, or get some OSGi metadata generated and an OSGi bundle created from them.
  • OSGi bundles which become part of the target platform in this way are then available to resolve the project's OSGi dependencies.


Tycho always attempts to resolve transitive dependencies, so if you need a POM dependency in the target platform of one module, you will also need it in all downstream modules. Therefore the POM dependencies (and the pomDependencies=consider configuration) typically need to be added in the parent POM.


Default value is: ignore.
<resolveWithExecutionEnvironmentConstraints> boolean - (no description)
Default value is: true.
<resolver> String - (no description)
Default value is: p2.
<target> Xpp3Dom - List of .target artifacts to use for dependency resolution.
Could either be
  • <artifact> to define a target GAV (either local to the reactor or a remote one)
  • <file> to define a file local to the build

<targetDefinitionIncludeSource> IncludeSourceMode - (no description)

Parameter Details

<allowConflictingDependencies>

(no description)
  • Type: boolean
  • Required: No
  • Default: false

<breeHeaderSelectionPolicy>

(no description)
  • Type: org.eclipse.tycho.core.TargetPlatformConfiguration$BREEHeaderSelectionPolicy
  • Required: No

<dependency-resolution>

Configure dependency resolution, for example by adding requirements. Example:
<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <configuration>
    <dependency-resolution>
      <extraRequirements>
        <requirement>
          <type>eclipse-feature</type>
          <id>example.project.feature</id>
          <versionRange>0.0.0</versionRange>
        </requirement>
      </extraRequirements>
    </dependency-resolution>
  </configuration>
 </plugin>
  • Type: java.lang.Object
  • Required: No

<environments>

Target environments (os/ws/arch) to consider.
  • Type: org.eclipse.tycho.core.shared.TargetEnvironment[]
  • Required: No

<executionEnvironment>

Force an execution environment for dependency resolution. If unset, the first targetJRE available in target is used.

Set to none to force the resolution to happen without any execution environment, typically when the module is supposed to use system packages coming from some dependencies (eg shipping a JRE inside products with Eclipse JustJ).

  • Type: java.lang.String
  • Required: No

<executionEnvironmentDefault>

(no description)
  • Type: java.lang.String
  • Required: No

<filters>

Selectively remove content from the target platform.

This for example allows to restrict the version of a bundle, or to select one particular provider for a package. Filtering is done as last step in the target platform computation, so the filters apply to all sources listed above.

The filters will only remove content from the target platform; they will not add new content. dependency-resolution should be used for addition of extra content. If you specify a restriction that is not fulfilled by any of the units from the target platform sources, all units that the filter applies to (i.e. units that match the filter.type, filter.id, and filter.version/versionRange criteria) will be removed from the target platform.

Package provider restrictions work by removing all other bundles exporting the package. This means that these other bundles (and the packages only exported by them) won't be available in your build.

Example:

<plugin> <groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version> <configuration> <filters>

<!-- example 1: restrict version of a bundle --> <filter>
<type>eclipse-plugin</type> <id>org.eclipse.osgi</id> <restrictTo>
<versionRange>[3.6,3.7)</versionRange> <!-- alternative: <version> for selecting
exactly one versions --> </restrictTo> </filter>

<!-- example 2: remove all providers of the package javax.persistence except the bundle
javax.persistence --> <filter> <type>java-package</type>
<id>javax.persistence</id> <restrictTo> <type>eclipse-plugin</type>
<id>javax.persistence</id> </restrictTo> </filter>

<!-- example 3: work around Equinox bug 348045 --> <filter>
<type>p2-installable-unit</type>
<id>org.eclipse.equinox.servletbridge.extensionbundle</id> <removeAll />
</filter> </filters> </configuration> </plugin>

<pre>
  • Type: java.util.List
  • Required: No

<includePackedArtifacts>

(no description)
  • Type: boolean
  • Required: No

<pomDependencies>

Defines which strategy to apply to Maven dependencies.

If consider or wrapAsBundle, the effect is:

  • First, Maven resolves the GAV dependencies according to the normal Maven rules. This results in a list of artifacts consisting of the specified artifacts and their transitive Maven dependencies.
  • Tycho then checks each of these artifacts, and if the artifact is an OSGi bundle, it is added to the target platform. Other artifacts are ignored in case of consider, or get some OSGi metadata generated and an OSGi bundle created from them.
  • OSGi bundles which become part of the target platform in this way are then available to resolve the project's OSGi dependencies.


Tycho always attempts to resolve transitive dependencies, so if you need a POM dependency in the target platform of one module, you will also need it in all downstream modules. Therefore the POM dependencies (and the pomDependencies=consider configuration) typically need to be added in the parent POM.

  • Type: org.eclipse.tycho.core.TargetPlatformConfiguration$PomDependencies
  • Required: No
  • Default: ignore

<resolveWithExecutionEnvironmentConstraints>

(no description)
  • Type: boolean
  • Required: No
  • Default: true

<resolver>

(no description)
  • Type: java.lang.String
  • Required: No
  • Default: p2

<target>

List of .target artifacts to use for dependency resolution.
Could either be
  • <artifact> to define a target GAV (either local to the reactor or a remote one)
  • <file> to define a file local to the build
  • Type: org.codehaus.plexus.util.xml.Xpp3Dom
  • Required: No

<targetDefinitionIncludeSource>

(no description)
  • Type: org.eclipse.tycho.core.resolver.shared.IncludeSourceMode
  • Required: No