Building XEclipse RCP with Maven

Last modified by clemens on 2010/03/08 23:03

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [dev:Drafts.BuildingXEclipseRCPWithMaven]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [dev:Drafts.BuildingXEclipseRCPWithMaven]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

This page tries to explain the Maven-based build process of the XEclipse RCP version by example. The steps below were performed under a Debian GNU/Linux 5.0 system. But they should also work under Mac OS X and its "rock-solid UNIX foundation" or a Cygwin-based Windows environment.

  1. Eclipse RCP environment
  2. Patches
  3. Building XEclipse from the trunk
  4. Building XEclipse from the sandbox
  5. Used software versions

Additional notes can be found at:

Eclipse RCP environment

To create an Eclipse RCP development environment you will need to download the Eclipse SDK, the RCP SDK and the DeltaPack package from http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/:

$ mkdir ~/xeclipse
$ cd ~/xeclipse

$ wget 'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-3.4-delta-pack.zip' \
'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-RCP-SDK-3.4-linux-gtk.tar.gz' \
'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4-linux-gtk.tar.gz'

$ ls -1
eclipse-3.4-delta-pack.zip
eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
eclipse-SDK-3.4-linux-gtk.tar.gz

$ md5sum *
49e913b17cbd3f2807e6b969a81f03d9  eclipse-3.4-delta-pack.zip
6b01bb0ae74748ddebe851f70672f75d  eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
4f7183395f61f70711a1f244faf5d763  eclipse-SDK-3.4-linux-gtk.tar.gz

Then you can setup everything like this:

$ cd ~/xeclipse

$ tar -zxvf eclipse-SDK-3.4-linux-gtk.tar.gz
$ cp eclipse/plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar eclipse/startup.jar
$ mv eclipse eclipse-3.4-sdk

$ tar -zxvf eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
$ unzip -o eclipse-3.4-delta-pack.zip
$ mv eclipse eclipse-3.4-sdk-rcp

$ ls -1
eclipse-3.4-sdk/
eclipse-3.4-sdk-rcp/
eclipse-3.4-delta-pack.zip
eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
eclipse-SDK-3.4-linux-gtk.tar.gz

$ ls -d ./eclipse-3.4-sdk/plugins/org.eclipse.pde.build_*
./eclipse-3.4-sdk/plugins/org.eclipse.pde.build_3.4.0.v20080604

Patches

Copy the following patches into the previously created xeclipse directory:

trunk-pom.xml.patch
This patch adds the snapshots repository to http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk/plugins/org.xwiki.eclipse.rcp/pom.xml. The artifact com.xpn.xwiki.platform:xwiki:pom:14-SNAPSHOT can't be found without this patch.
sandbox-pom.xml.patch
This patch adds the snapshots repository to http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse/org.xwiki.eclipse.rcp/pom.xml. The artifact com.xpn.xwiki.platform:xwiki:pom:14-SNAPSHOT can't be found without this patch.
sandbox-copy-dependencies-pom.xml.patch
This patch adds the externals, the releases and the snapshots repository to http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse/org.xwiki.eclipse.ui/copy-dependencies-pom.xml. Most artifacts from copy-dependencies-pom.xml are located in these repositories.
sandbox-build.properties.patch
sandbox-MANIFEST.MF.patch
This two patches add xwiki-core-properties-2.0-SNAPSHOT.jar to the OSGi bundle org.xwiki.eclipse.ui_1.2.0.RC1.jar. Prevents NoClassDefFoundErrors at runtime.
$ cd ~/xeclipse

$ ls -1 *.patch
sandbox-MANIFEST.MF.patch
sandbox-build.properties.patch
sandbox-copy-dependencies-pom.xml.patch
sandbox-pom.xml.patch
trunk-pom.xml.patch

Building XEclipse from the trunk

$ cd ~/xeclipse

$ svn co http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk trunk

$ ls -1
eclipse-3.4-sdk/
eclipse-3.4-sdk-rcp/
trunk/
eclipse-3.4-delta-pack.zip
eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
eclipse-SDK-3.4-linux-gtk.tar.gz
sandbox-MANIFEST.MF.patch
sandbox-build.properties.patch
sandbox-copy-dependencies-pom.xml.patch
sandbox-pom.xml.patch
trunk-pom.xml.patch

$ cd trunk/plugins/org.xwiki.eclipse.rcp

$ patch -p1 < ~/xeclipse/trunk-pom.xml.patch

$ mvn compile -DeclipseInstall=../../../eclipse-3.4-sdk \
-DeclipseRCPSDK=../../../eclipse-3.4-sdk-rcp \
-DpdeBuildVersion=3.4.0.v20080604 -Plinux

$ ls ../../M.XEclipse/*.zip
../../M.XEclipse/XEclipse-linux.gtk.x86.zip

The ZIP archive of the generated RCP application is saved in ~/xeclipse/trunk/M.XEclipse.

Building XEclipse from the sandbox

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [dev:Drafts.BuildingXEclipseRCPWithMaven]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

$ cd ~/xeclipse

$ svn co http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk sandbox/trunk
$ svn co http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse sandbox/sandbox

$ ls -1
eclipse-3.4-sdk/
eclipse-3.4-sdk-rcp/
sandbox/
trunk/
eclipse-3.4-delta-pack.zip
eclipse-RCP-SDK-3.4-linux-gtk.tar.gz
eclipse-SDK-3.4-linux-gtk.tar.gz
sandbox-MANIFEST.MF.patch
sandbox-build.properties.patch
sandbox-copy-dependencies-pom.xml.patch
sandbox-pom.xml.patch
trunk-pom.xml.patch

$ cd sandbox/trunk/plugins
$ rm -rf org.xwiki.eclipse.core org.xwiki.eclipse.rcp org.xwiki.eclipse.ui org.xwiki.eclipse.xmlrpc
$ cp -r ../../sandbox/* .

$ cd org.xwiki.eclipse.ui

$ patch -p1 < ~/xeclipse/sandbox-copy-dependencies-pom.xml.patch

$ mvn -f copy-dependencies-pom.xml dependency:copy-dependencies

$ patch -p1 < ~/xeclipse/sandbox-build.properties.patch

$ cd META-INF

$ patch -p2 < ~/xeclipse/sandbox-MANIFEST.MF.patch

$ cd ../../org.xwiki.eclipse.rcp

$ patch -p1 < ~/xeclipse/sandbox-pom.xml.patch

$ mvn compile -DeclipseInstall=../../../../eclipse-3.4-sdk \
-DeclipseRCPSDK=../../../../eclipse-3.4-sdk-rcp \
-DpdeBuildVersion=3.4.0.v20080604 -Plinux

$ ls ../../M.XEclipse/*.zip
../../M.XEclipse/XEclipse-linux.gtk.x86.zip

The ZIP archive of the generated RCP application is saved in ~/xeclipse/sandbox/trunk/M.XEclipse.

Used software versions

$ export JAVA_HOME=/opt/jdk-1.6.0
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -version
java version "1.6.0_16"

$ export M2_HOME=/opt/maven-2.2.1
$ export PATH=$M2_HOME/bin:$PATH
$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 19:16:01+0000)

$ bash --version
GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)

$ md5sum --version
md5sum (GNU coreutils) 6.10

$ svn --version
svn, version 1.5.1 (r32289)

$ tar --version
tar (GNU tar) 1.20

$ patch --version
patch 2.5.9

$ unzip --version
UnZip 5.52 of 28 February 2005, by Debian. Original by Info-ZIP.

$ wget --version
GNU Wget 1.11.4

Get Connected