Jump to: navigation, search

Equinox/p2/Build

< Equinox‎ | p2

Executive summary

git clone git://git.eclipse.org/gitroot/equinox/rt.equinox.p2.git
cd rt.equinox.p2
mvn  verify -Declipse-sdk-repo.url=http://download.eclipse.org/eclipse/updates/4.4-N-builds -Dmaven.test.skip=false

Bree build:

mvn  verify -Pbree-libs -Declipse-sdk-repo.url=http://download.eclipse.org/eclipse/updates/4.4-N-builds -Dmaven.test.skip=false

Details

Note: P2 seems to be the first Platform project getting a standalone maven build, so those steps may be useful for others trying to separate their modules and establish CI.

A large, monolitic build of Eclipse Platform [[1]] is not suitable for continuous integration. Following steps were made to ensure that it is possible to build P2 as a standalone project:

Clean up

P2 build must have a single connection with the Platform CBI build. Therefore it is necessary that only one pom.xml file contains a reference to eclipse-platform-parent. In case of P2 it was not the case. Bug 416731 - root pom does not have to have parent pom.

Note: It is still unverified whether the remaining reference to the eclipse-parent-pom does have to have relative path specified. For the sake of correctness it would be good to remove it, if the platform CBI build will not be broken.

Dependencies

Some Equinox/Platform bundles are necessary to run conclude the build successfully. eclipse-platform-parent has an undocumented feature of partial-build, so when the eclipse-sdk-repo.url property is set, dependencies that are not in the reactor are fetched from the repository pointed by that property. [Nightly build of Eclipse] is a pretty good base for P2 builds.

eclipse-platform-parent

eclipse-platform-parent is a place where a lot of important configuration options is stored. It would be unreasonable to duplicate that information in the p2 poms, so it is necessary to somehow get and use the parent pom. The partial build feature described in a previous point consists of a profile, so it is possible to change that profile to look for dependencies (including poms) in [Eclipse Maven Repository ].

bree-libs

It is possible to add -Pbree-libs to the build. The [bree-libs] profile is inherited from eclipse-platform-parent. If this is ommited, all bundles are compiled against local version of VM.

Tests

Platform build has tests disabled in the eclipse-platform-parent. It is necessary to override that setting by specifying -Dmaven.test.skip=false. Unfortunately some tests are not trivial to adopt to maven, so in order to get a best coverage, the partial-build needs to be able to complete the build despite errors, hence the configuration in the pom <testFailureIgnore>true</testFailureIgnore>.

Hacks and workarounds

eclipse-platform-parent is a bit out of date, therefore it is necessary to add org.eclipse.osgi.compatibility.state dependency to all tests bundles. This issue is caused by changes in Equinox, and it should be removed when a proper, up-to-date eclipse-platform-parent is published to repo.eclipse.org.

Things still to do

  1. test whether a path to eclipse-parent-pom is necessary in the platform CBI build.
  2. expose P2 build as an update site