This Maven plugin adds POM-first dependencies to Eclipse PDE target platform. It is intended to help with Eclipse plugin development using Eclipse Tycho and PDE, when Maven OSGI dependencies are used.

Eclipse Tycho normally uses p2 repositories to resolve build dependencies. However, it also allows using OSGI bundles from Maven repository (POM-first dependencies) with configuration option <pomDependencies>consider</pomDependencies> (see Tycho POM-first dependencies). Unfortunately, the POM-first dependencies cannot be easily included in Target Platform Definition. This means that when the Tycho target platform is used in Eclipse PDE, it lacks the POM-first dependencies, leading to different target platforms between Tycho and within Eclipse IDE.

The pde-target-maven-plugin aims to help with this disparity: it can augment the base Target Definition used by Tycho with POM-first dependencies resolved against the local Maven repository. The generated target definition file will contain original locations, but will also add Directory locations to each POM dependency.

Goals overview

The PDE target definition plugin only has one goal:

  • pde-target:add-pom-dependencies adds POM-first dependencies of the project to the indicated base target definition file and writes a new target definition.

Usage

Refer to goal description for the list of all configuration options for PDE target definition plugin. Note that the plugin reuses Maven Dependency Plugin so a lot of configuration options are shared with dependency goals.

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>lt.velykis.maven</groupId>
        <artifactId>pde-target-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <id>pde-target</id>
            <goals>
              <goal>add-pom-dependencies</goal>
            </goals>
            <configuration>
              <baseDefinition>${project.basedir}/my-target.target</baseDefinition>
              <outputFile>${project.build.directory}/my-target-pde.target</outputFile>
            </configuration>
          </execution>
        </executions>
        ...
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

Set target platform

The use of generated target platform is quite straightforward with Eclipse Maven integration.

  1. First, import the Maven projects - this will resolve all POM dependencies into the local Maven repository.
  2. The add-pom-dependencies goal supports m2e out of the box, so the new target definition file will be generated automatically with resolved locations of POM-first dependencies.
  3. Finally, select the generated target definition file and set as Target Platform.

Back to top

Version: 1.0.1. Last Published: 2013-03-05.

Reflow Maven skin by Andrius Velykis.