Wiki source code of Building XEclipse RCP with Maven
Last modified by clemens on 2010/03/08 23:03
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{velocity}} |
| 2 | {{html}} | ||
| 3 | #warning("Be warned: This is a draft and everything here works on my machine.") | ||
| 4 | {{/html}} | ||
| 5 | {{/velocity}} | ||
| 6 | |||
| 7 | {{velocity}} | ||
| 8 | {{html}} | ||
| 9 | #startfloatingbox() | ||
| |
4.1 | 10 | <a href='http://www.codinghorror.com/blog/archives/000818.html'><img src='http://codinghorror.typepad.com/.a/6a0120a85dcdae970b0128776ff992970c-pi' width='150' height='144'/></a> |
| |
1.1 | 11 | #endfloatingbox() |
| 12 | {{/html}} | ||
| 13 | {{/velocity}} | ||
| 14 | |||
| 15 | 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>>http://www.debian.org/]] system. But they should also work under [[Mac OS X>>http://www.apple.com/macosx/]] and its [["rock-solid UNIX foundation">>http://www.apple.com/macosx/what-is-macosx/core-foundation.html]] or a [[Cygwin-based Windows environment>>http://www.cygwin.com/]]. | ||
| 16 | |||
| 17 | {{toc start="2" numbered="true"/}} | ||
| 18 | |||
| 19 | Additional notes can be found at: | ||
| 20 | |||
| 21 | * [[Building XEclipse>>http://dev.xwiki.org/xwiki/bin/view/Community/Building#HBuildingXEclipse]] | ||
| 22 | * http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk/README | ||
| 23 | * http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk/plugins/org.xwiki.eclipse.rcp/README | ||
| 24 | * http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse/README | ||
| 25 | * http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse/org.xwiki.eclipse.rcp/README | ||
| 26 | |||
| 27 | == Eclipse RCP environment == | ||
| 28 | |||
| 29 | 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/: | ||
| 30 | |||
| 31 | {{code language="bash"}} | ||
| 32 | $ mkdir ~/xeclipse | ||
| 33 | $ cd ~/xeclipse | ||
| 34 | |||
| 35 | $ wget 'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-3.4-delta-pack.zip' \ | ||
| 36 | 'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-RCP-SDK-3.4-linux-gtk.tar.gz' \ | ||
| 37 | 'http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4-linux-gtk.tar.gz' | ||
| 38 | |||
| 39 | $ ls -1 | ||
| 40 | eclipse-3.4-delta-pack.zip | ||
| 41 | eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 42 | eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 43 | |||
| 44 | $ md5sum * | ||
| 45 | 49e913b17cbd3f2807e6b969a81f03d9 eclipse-3.4-delta-pack.zip | ||
| 46 | 6b01bb0ae74748ddebe851f70672f75d eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 47 | 4f7183395f61f70711a1f244faf5d763 eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 48 | {{/code}} | ||
| 49 | |||
| 50 | Then you can setup everything like this: | ||
| 51 | |||
| 52 | {{code language="bash"}} | ||
| 53 | $ cd ~/xeclipse | ||
| 54 | |||
| 55 | $ tar -zxvf eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 56 | $ cp eclipse/plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar eclipse/startup.jar | ||
| 57 | $ mv eclipse eclipse-3.4-sdk | ||
| 58 | |||
| 59 | $ tar -zxvf eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 60 | $ unzip -o eclipse-3.4-delta-pack.zip | ||
| 61 | $ mv eclipse eclipse-3.4-sdk-rcp | ||
| 62 | |||
| 63 | $ ls -1 | ||
| 64 | eclipse-3.4-sdk/ | ||
| 65 | eclipse-3.4-sdk-rcp/ | ||
| 66 | eclipse-3.4-delta-pack.zip | ||
| 67 | eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 68 | eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 69 | |||
| 70 | $ ls -d ./eclipse-3.4-sdk/plugins/org.eclipse.pde.build_* | ||
| 71 | ./eclipse-3.4-sdk/plugins/org.eclipse.pde.build_3.4.0.v20080604 | ||
| 72 | {{/code}} | ||
| 73 | |||
| 74 | == Patches == | ||
| 75 | |||
| 76 | Copy the following patches into the previously created xeclipse directory: | ||
| 77 | |||
| 78 | ; attach:trunk-pom.xml.patch | ||
| 79 | : 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. | ||
| 80 | ; attach:sandbox-pom.xml.patch | ||
| 81 | : 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. | ||
| 82 | ; attach:sandbox-copy-dependencies-pom.xml.patch | ||
| 83 | : 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. | ||
| 84 | ; attach:sandbox-build.properties.patch | ||
| 85 | ; attach:sandbox-MANIFEST.MF.patch | ||
| 86 | : 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. | ||
| 87 | |||
| 88 | |||
| 89 | {{code language="bash"}} | ||
| 90 | $ cd ~/xeclipse | ||
| 91 | |||
| 92 | $ ls -1 *.patch | ||
| 93 | sandbox-MANIFEST.MF.patch | ||
| 94 | sandbox-build.properties.patch | ||
| 95 | sandbox-copy-dependencies-pom.xml.patch | ||
| 96 | sandbox-pom.xml.patch | ||
| 97 | trunk-pom.xml.patch | ||
| 98 | {{/code}} | ||
| 99 | |||
| 100 | == Building XEclipse from the trunk == | ||
| 101 | |||
| 102 | {{code language="bash"}} | ||
| 103 | $ cd ~/xeclipse | ||
| 104 | |||
| 105 | $ svn co http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk trunk | ||
| 106 | |||
| 107 | $ ls -1 | ||
| 108 | eclipse-3.4-sdk/ | ||
| 109 | eclipse-3.4-sdk-rcp/ | ||
| 110 | trunk/ | ||
| 111 | eclipse-3.4-delta-pack.zip | ||
| 112 | eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 113 | eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 114 | sandbox-MANIFEST.MF.patch | ||
| 115 | sandbox-build.properties.patch | ||
| 116 | sandbox-copy-dependencies-pom.xml.patch | ||
| 117 | sandbox-pom.xml.patch | ||
| 118 | trunk-pom.xml.patch | ||
| 119 | |||
| 120 | $ cd trunk/plugins/org.xwiki.eclipse.rcp | ||
| 121 | |||
| 122 | $ patch -p1 < ~/xeclipse/trunk-pom.xml.patch | ||
| 123 | |||
| 124 | $ mvn compile -DeclipseInstall=../../../eclipse-3.4-sdk \ | ||
| 125 | -DeclipseRCPSDK=../../../eclipse-3.4-sdk-rcp \ | ||
| 126 | -DpdeBuildVersion=3.4.0.v20080604 -Plinux | ||
| 127 | |||
| 128 | $ ls ../../M.XEclipse/*.zip | ||
| 129 | ../../M.XEclipse/XEclipse-linux.gtk.x86.zip | ||
| 130 | {{/code}} | ||
| 131 | |||
| 132 | The ZIP archive of the generated RCP application is saved in {{{~/xeclipse/trunk/M.XEclipse}}}. | ||
| 133 | |||
| 134 | == Building XEclipse from the sandbox == | ||
| 135 | |||
| 136 | {{velocity}} | ||
| 137 | {{html}} | ||
| 138 | #error("To build XEclipse from the sandbox, I have to move the SVN working copy of the sandbox into the working copy of the trunk. It works, but it doesn't feel right. Is there no other way?") | ||
| 139 | {{/html}} | ||
| 140 | {{/velocity}} | ||
| 141 | |||
| 142 | {{code language="bash"}} | ||
| 143 | $ cd ~/xeclipse | ||
| 144 | |||
| 145 | $ svn co http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk sandbox/trunk | ||
| 146 | $ svn co http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xeclipse sandbox/sandbox | ||
| 147 | |||
| 148 | $ ls -1 | ||
| 149 | eclipse-3.4-sdk/ | ||
| 150 | eclipse-3.4-sdk-rcp/ | ||
| 151 | sandbox/ | ||
| 152 | trunk/ | ||
| 153 | eclipse-3.4-delta-pack.zip | ||
| 154 | eclipse-RCP-SDK-3.4-linux-gtk.tar.gz | ||
| 155 | eclipse-SDK-3.4-linux-gtk.tar.gz | ||
| 156 | sandbox-MANIFEST.MF.patch | ||
| 157 | sandbox-build.properties.patch | ||
| 158 | sandbox-copy-dependencies-pom.xml.patch | ||
| 159 | sandbox-pom.xml.patch | ||
| 160 | trunk-pom.xml.patch | ||
| 161 | |||
| 162 | $ cd sandbox/trunk/plugins | ||
| 163 | $ rm -rf org.xwiki.eclipse.core org.xwiki.eclipse.rcp org.xwiki.eclipse.ui org.xwiki.eclipse.xmlrpc | ||
| 164 | $ cp -r ../../sandbox/* . | ||
| 165 | |||
| 166 | $ cd org.xwiki.eclipse.ui | ||
| 167 | |||
| 168 | $ patch -p1 < ~/xeclipse/sandbox-copy-dependencies-pom.xml.patch | ||
| 169 | |||
| 170 | $ mvn -f copy-dependencies-pom.xml dependency:copy-dependencies | ||
| 171 | |||
| 172 | $ patch -p1 < ~/xeclipse/sandbox-build.properties.patch | ||
| 173 | |||
| 174 | $ cd META-INF | ||
| 175 | |||
| 176 | $ patch -p2 < ~/xeclipse/sandbox-MANIFEST.MF.patch | ||
| 177 | |||
| 178 | $ cd ../../org.xwiki.eclipse.rcp | ||
| 179 | |||
| 180 | $ patch -p1 < ~/xeclipse/sandbox-pom.xml.patch | ||
| 181 | |||
| 182 | $ mvn compile -DeclipseInstall=../../../../eclipse-3.4-sdk \ | ||
| 183 | -DeclipseRCPSDK=../../../../eclipse-3.4-sdk-rcp \ | ||
| 184 | -DpdeBuildVersion=3.4.0.v20080604 -Plinux | ||
| 185 | |||
| 186 | $ ls ../../M.XEclipse/*.zip | ||
| 187 | ../../M.XEclipse/XEclipse-linux.gtk.x86.zip | ||
| 188 | {{/code}} | ||
| 189 | |||
| 190 | The ZIP archive of the generated RCP application is saved in {{{~/xeclipse/sandbox/trunk/M.XEclipse}}}. | ||
| 191 | |||
| 192 | == Used software versions == | ||
| 193 | |||
| 194 | {{code language="bash"}} | ||
| 195 | $ export JAVA_HOME=/opt/jdk-1.6.0 | ||
| 196 | $ export PATH=$JAVA_HOME/bin:$PATH | ||
| 197 | $ java -version | ||
| 198 | java version "1.6.0_16" | ||
| 199 | |||
| 200 | $ export M2_HOME=/opt/maven-2.2.1 | ||
| 201 | $ export PATH=$M2_HOME/bin:$PATH | ||
| 202 | $ mvn -version | ||
| 203 | Apache Maven 2.2.1 (r801777; 2009-08-06 19:16:01+0000) | ||
| 204 | |||
| 205 | $ bash --version | ||
| 206 | GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu) | ||
| 207 | |||
| 208 | $ md5sum --version | ||
| 209 | md5sum (GNU coreutils) 6.10 | ||
| 210 | |||
| 211 | $ svn --version | ||
| 212 | svn, version 1.5.1 (r32289) | ||
| 213 | |||
| 214 | $ tar --version | ||
| 215 | tar (GNU tar) 1.20 | ||
| 216 | |||
| 217 | $ patch --version | ||
| 218 | patch 2.5.9 | ||
| 219 | |||
| 220 | $ unzip --version | ||
| 221 | UnZip 5.52 of 28 February 2005, by Debian. Original by Info-ZIP. | ||
| 222 | |||
| 223 | $ wget --version | ||
| 224 | GNU Wget 1.11.4 | ||
| 225 | {{/code}} |