Skip to main content
Jump to: navigation, search

Difference between revisions of "Equinox/p2/Build"

< Equinox‎ | p2
m (Clean up)
(416676 document for external users; remove notes about the process of making the build possible)
 
Line 1: Line 1:
== Executive summary ==
+
== Building p2 ==
  
 +
Clone the rt.equinox.p2 Git repository (see [http://projects.eclipse.org/projects/rt.equinox.p2/developer developer resources]) and execute the following command in the root of the source tree:
 
<pre>
 
<pre>
git clone git://git.eclipse.org/gitroot/equinox/rt.equinox.p2.git
+
mvn clean verify -Pbuild-individual-bundles -DskipTests=false
cd rt.equinox.p2
+
mvn verify -Declipse-sdk-repo.url=http://download.eclipse.org/eclipse/updates/4.4-N-builds -Dmaven.test.skip=false
+
 
</pre>
 
</pre>
  
Bree build:
+
=== Getting the eclipse-platform-parent ===
 +
 
 +
In case the build fails due to a "non-resolvable parent POM", the eclipse-platform-parent is not available from any of the Maven repositories in your build environment. You can make the eclipse-platform-parent and other required Maven artifacts available by adding the following configuration in your [http://maven.apache.org/settings.html settings.xml]:
 +
 
 
<pre>
 
<pre>
mvn  verify -Pbree-libs -Declipse-sdk-repo.url=http://download.eclipse.org/eclipse/updates/4.4-N-builds -Dmaven.test.skip=false
+
<profiles>
 +
  <profile>
 +
      <id>cbi</id>
 +
      <pluginRepositories>
 +
        <pluginRepository>
 +
            <id>eclipse.releases</id>
 +
            <url>https://repo.eclipse.org/content/repositories/releases/</url>
 +
            <snapshots>
 +
              <enabled>false</enabled>
 +
            </snapshots>
 +
        </pluginRepository>
 +
        <pluginRepository>
 +
            <id>eclipse.snapshots</id>
 +
            <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
 +
        </pluginRepository>
 +
      </pluginRepositories>
 +
      <repositories>
 +
        <repository>
 +
            <id>eclipse.releases</id>
 +
            <url>https://repo.eclipse.org/content/repositories/releases/</url>
 +
            <snapshots>
 +
              <enabled>false</enabled>
 +
            </snapshots>
 +
        </repository>
 +
        <repository>
 +
            <id>eclipse.snapshots</id>
 +
            <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
 +
        </repository>
 +
      </repositories>
 +
  </profile>
 +
</profiles>
 
</pre>
 
</pre>
  
== Details ==
+
Either activate the above profile by adding <code>-Pcbi</code> to the Maven command, or by adding the following additional settings.xml configuration:
 
+
<pre>
<b> Note: </b> 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.
+
<activeProfiles>
 
+
  <activeProfile>cbi</activeProfile>
A large, monolitic build of Eclipse Platform [[http://wiki.eclipse.org/CBI/Eclipse_Platform_Build]] is not suitable for continuous integration. Following steps were made to ensure that it is possible to build P2 as a standalone project:
+
</activeProfiles>
 
+
</pre>
=== 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. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=416731 Bug 416731 - root pom does not have to have parent pom].
+
 
+
<b> Note: </b> 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. [[http://download.eclipse.org/eclipse/updates/4.4-N-builds 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 [[http://repo.eclipse.org/content/repositories/eclipse-snapshots/ Eclipse Maven Repository ]].
+
 
+
=== bree-libs  ===
+
It  is possible to add -Pbree-libs  to the build. The [[http://wiki.eclipse.org/Platform-releng/Platform_Build#Using_BREE_Libs 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 <code>-Dmaven.test.skip=false</code>. 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 <code><testFailureIgnore>true</testFailureIgnore></code>.
+
 
+
== Hacks and workarounds ==
+
eclipse-platform-parent is a bit out of date, therefore it is necessary to add <code>org.eclipse.osgi.compatibility.state</code> 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 ==
+
== Further information  ==
# test whether a path to eclipse-parent-pom is necessary in the platform CBI build.
+
* The p2 build can be executed with <code>-Pbree-libs</code>. See [[Platform-releng/Platform_Build#Using_BREE_Libs|Using BREE Libs]] for details.
# expose P2 build as an update site
+
* CI build server: https://hudson.eclipse.org/p2/

Latest revision as of 11:45, 8 January 2015

Building p2

Clone the rt.equinox.p2 Git repository (see developer resources) and execute the following command in the root of the source tree:

mvn clean verify -Pbuild-individual-bundles -DskipTests=false

Getting the eclipse-platform-parent

In case the build fails due to a "non-resolvable parent POM", the eclipse-platform-parent is not available from any of the Maven repositories in your build environment. You can make the eclipse-platform-parent and other required Maven artifacts available by adding the following configuration in your settings.xml:

<profiles>
   <profile>
      <id>cbi</id>
      <pluginRepositories>
         <pluginRepository>
            <id>eclipse.releases</id>
            <url>https://repo.eclipse.org/content/repositories/releases/</url>
            <snapshots>
               <enabled>false</enabled>
            </snapshots>
         </pluginRepository>
         <pluginRepository>
            <id>eclipse.snapshots</id>
            <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
         </pluginRepository>
      </pluginRepositories>
      <repositories>
         <repository>
            <id>eclipse.releases</id>
            <url>https://repo.eclipse.org/content/repositories/releases/</url>
            <snapshots>
               <enabled>false</enabled>
            </snapshots>
         </repository>
         <repository>
            <id>eclipse.snapshots</id>
            <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
         </repository>
      </repositories>
   </profile>
</profiles>

Either activate the above profile by adding -Pcbi to the Maven command, or by adding the following additional settings.xml configuration:

<activeProfiles>
   <activeProfile>cbi</activeProfile>
</activeProfiles>

Further information

Back to the top