Changes for page Building XWiki from sources
Last modified by Vincent Massol on 2024/04/08 16:22
From version 37.1
edited by stevejones
on 2010/01/12 13:05
on 2010/01/12 13:05
Change comment:
There is no comment for this version
To version 38.1
edited by Vincent Massol
on 2010/01/12 13:18
on 2010/01/12 13:18
Change comment:
Rollback to version 36.2
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. stevejones1 +xwiki:XWiki.VincentMassol - Content
-
... ... @@ -120,62 +120,66 @@ 120 120 121 121 Projects are directories found under the XWiki SVN root. For example: platform, enterprise, manager, etc. 122 122 123 -To build them, check them out and run mvn install. 123 +To build them, check them out and run <tt>mvn install</tt>. 124 124 125 125 Each project is made of modules. Thanks to XWiki's [Continuous Integration setup>Community.DevelopmentPractices#HContinuousIntegration] you can check out and build any single module (and its children) you wish without having to rebuild the other modules from source. Maven will pick the latest version of your module's dependencies from [XWiki's Maven remote repositories>http://maven.xwiki.org]. Of course if you have uncommitted changes in a dependent module, you'll want to build that module before. The build result is placed in two places: 126 - 127 127 - the [local maven repository>http://maven.apache.org/guides/introduction/introduction-to-repositories.html], for making the module available to other projects or modules using maven (even other XWiki modules take the needed libraries from this repository, and not directly from a "neighbor" directory) 128 -- and in a subdirectory of that module, called target. 127 +- and in a subdirectory of that module, called <tt>target</tt>. 129 129 130 -#info("Now some of the modules built by XWiki are very large (in the 40MB+ size) and sometimes you don't absolutely need the latest version to get downloaded as it'll take too long. In that case here's a tip: run Maven in 'no-snapshot-update' mode with mvn install -nsu.") 131 -#warning("You might encounter an java.lang.OutOfMemoryError during aspectj:compile. You must increase the maximum memory used by maven, by setting MAVEN_OPTS=-Xmx512m (or a different amount of memory).") 129 +#info("Now some of the modules built by XWiki are very large (in the 40MB+ size) and sometimes you don't absolutely need the latest version to get downloaded as it'll take too long. In that case here's a tip: run Maven in 'no-snapshot-update' mode with <tt>mvn install -nsu</tt>.") 132 132 131 +#warning("You might encounter an <tt>java.lang.OutOfMemoryError</tt> during <tt>aspectj:compile</tt>. You must increase the maximum memory used by maven, by setting <tt>MAVEN_OPTS=-Xmx512m</tt> (or a different amount of memory).") 132 + 133 133 You'll find below some common build tasks. 134 134 135 135 1.1.1 Building for a specific database 136 136 137 -By default XWiki's Maven build will use Hypersonic SQL as the default database. If you wish to execute the build using a different database, you'll need to specify the correct database profile (-P). Right now we support 4 profiles: 137 +By default XWiki's Maven build will use Hypersonic SQL as the default database. If you wish to execute the build using a different database, you'll need to specify the correct database profile (<tt>-P<profile name></tt>). Right now we support 4 profiles: 138 +* <tt>hsqldb</tt>: Hypersonic SQL. This is the default 139 +* <tt>mysql</tt>: MySQL 140 +* <tt>pgsql</tt>: PostGreSQL 141 +* <tt>derby</tt>: Apache Derby 138 138 139 -* hsqldb: Hypersonic SQL. This is the default 140 -* mysql: MySQL 141 -* pgsql: PostGreSQL 142 -* derby: Apache Derby 143 +For example to build a module for MySQL type <tt>mvn install -Pmysql</tt> in that module's directory. 143 143 144 -For example to build a module for MySQL type mvn install -Pmysql in that module's directory. 145 - 146 146 #warning("Hypersonic and Derby are embedded database so you won't need anything setup to execute the build for them. However for MySQL and PostGreSQL you'll need to have the database installed, set up and running before you can run the build with their profiles. 147 147 148 -A simple way to do this is to define the necessary properties within {HOME}/.m2/settings.xml as explained above when configuring the maven mirrors. Check the property names required by looking at the corresponding profiles section in the [platform's top level pom.xml file>http://svn.xwiki.org/svnroot/xwiki/platform/pom/trunk/pom.xml] 149 - 147 +A simple way to do this is to define the necessary properties within <tt>{HOME}/.m2/settings.xml</tt> as explained above when configuring the maven mirrors. Check the property names required by looking at the corresponding profiles section in the [platform's top level pom.xml file>http://svn.xwiki.org/svnroot/xwiki/platform/pom/trunk/pom.xml] 150 150 ") 151 151 152 152 1.1.1 Building on Windows 153 153 154 -To build on Windows, you should specify the windows profile (-Pwindows). 152 +To build on Windows, you should specify the <tt>windows</tt> profile (<tt>-Pwindows</tt>). 155 155 156 156 1.1.1 Building XWiki Enterprise 157 157 158 -Go in enterprise/ and type mvn install. It'll build it with a default config for HSQL DB. 159 -##info("If you wish to build all the modules required for XWiki Enterprise and not the ones required by other products you can go at the top level and type mvn install") 160 -#info("The functional tests are not executed by default as the take a long time to execute and are meant mostly to be executed by the Continuous Integration tool. However if you wish to run them you can execute mvn install -Pxe,ci") 161 -#info("The installer builds are not executed by default (they are executed on the Continuous Integration server though). If you wish to run them you can execute mvn install -Pxe,ci or better, go in xwiki-product-enterprise/installers and run mvn install.") 156 +Go in <tt>enterprise/</tt> and type <tt>mvn install</tt>. It'll build it with a default config for HSQL DB. 162 162 158 +##info("If you wish to build all the modules required for XWiki Enterprise and not the ones required by other products you can go at the top level and type <tt>mvn install</tt>") 159 + 160 +#info("The functional tests are not executed by default as the take a long time to execute and are meant mostly to be executed by the Continuous Integration tool. However if you wish to run them you can execute <tt>mvn install -Pxe,ci</tt>") 161 + 162 +#info("The installer builds are not executed by default (they are executed on the Continuous Integration server though). If you wish to run them you can execute <tt>mvn install -Pxe,ci</tt> or better, go in <tt>xwiki-product-enterprise/installers</tt> and run <tt>mvn install</tt>.") 163 + 163 163 1.1.1 Executing the Automated Functional Tests for XWiki Enterprise 164 164 165 -Go in enterprise/distribution-test and type mvn install. By default they are executed in Firefox. To run them in a different browser, use a profile. For example to run them in IE, type mvn install -Piexplore. 166 +Go in <tt>enterprise/distribution-test</tt> and type <tt>mvn install</tt>. By default they are executed in Firefox. To run them in a different browser, use a profile. For example to run them in IE, type <tt>mvn install -Piexplore</tt>. 166 166 167 167 See the [Testing] page for more details. 168 168 169 169 1.1.1 Executing the Standard Web WAR quickly in development mode 170 170 171 -Go in platform/[web>http://www.plaveb.com/]/standard and type mvn install -Pjettyrun. This will execute it on Jetty with a HSQLDB database located in platform/web/standard/database (we need to improve the build to locate it elsewhere). So if you want to have any content displayed you'll need to put a HSQLDB there or simply import a XAR. 172 -#info("If you wish to use another database like MySQL, run mvn install -Pjettyrun,mysql. See the section above on building XWiki for a specific database for more information.") 173 -Once the build has started Jetty, open your browser and point it to http://localhost:8080/xwiki. 174 -To debug in this mode, run MAVEN_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n' mvn install -Pjettyrun and attach you IDE to this process as in [Debugging#HRemoteDebugging]. 175 -Note that this is a quick way of starting XWiki in development mode. However the real test is to start the XWiki Enterprise standalone distribution to ensure that everything works. This is achieved by running mvn install in enterprise/. 172 +Go in <tt>platform/web/standard</tt> and type <tt>mvn install -Pjettyrun</tt>. This will execute it on Jetty with a HSQLDB database located in <tt>platform/web/standard/database</tt> (we need to improve the build to locate it elsewhere). So if you want to have any content displayed you'll need to put a HSQLDB there or simply import a XAR. 176 176 177 -#info(" Herearesome alternative strategiesusedbyXWikicommitters:174 +#info("If you wish to use another database like MySQL, run <tt>mvn install -Pjettyrun,mysql</tt>. See the section above on building XWiki for a specific database for more information.") 178 178 176 +Once the build has started Jetty, open your browser and point it to <tt>http://localhost:8080/xwiki</tt>. 177 + 178 +To debug in this mode, run <tt>MAVEN_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n' mvn install -Pjettyrun</tt> and attach you IDE to this process as in [Debugging#HRemoteDebugging]. 179 + 180 +Note that this is a quick way of starting XWiki in development mode. However the real test is to start the XWiki Enterprise standalone distribution to ensure that everything works. This is achieved by running <tt>mvn install</tt> in <tt>enterprise/</tt>. 181 + 182 +#info("Here are some alternative strategies used by XWiki committers: 179 179 * [Debug with Eclipse and m2eclipse>dev:Community.DebugXEWithEclipse] 180 180 * Keep a running XE and copy modified files to it. You can even start your container in development mode so that it reloads the copied files automatically. 181 181 * Download the latest XE SNAPSHOT from [XWiki's Continuous Integration server>http://maven.xwiki.org/snapshots/] and unzip it and then start it.") ... ... @@ -184,17 +184,18 @@ 184 184 185 185 #warning("You'll need Eclipse 3.3.x (or above) and an associated PDE (Plugin Development Environment) in order to build XEclipse from source.") 186 186 187 -This section is about building XEclipse with maven. For instructions on how to build XEclipse from right within the Eclipse IDE, you may refer to [http://dev.xwiki.org/xwiki/bin/view/Community/BuildingInEclipse " class="undefined">Building in Eclipse\">\<a class=]191 +This section is about building XEclipse with maven. For instructions on how to build XEclipse from right within the Eclipse IDE, you may refer to [\[Building in Eclipse\]>http://dev.xwiki.org/xwiki/bin/view/Community/BuildingInEclipse] 188 188 189 189 1.1.1.1 Building XEclipse as an Eclipse plugin 190 190 191 191 Change directory to ~~plugins/org.xwiki.eclipse~~\\ 192 -Run ~~mvn install -DeclipseInstall=$ECLIPSE _DIR~~196 +Run ~~mvn install -DeclipseInstall=$ECLIPSE_DIR~~ 193 193 194 194 1.1.1.1 Builing XEclipse as a standalone application 195 195 196 196 You will need the [pde-maven-plugin>http://mojo.codehaus.org/pde-maven-plugin/]. 197 197 Once this maven plugin is installed, please refer to ~~plugins/org.xwiki.eclipse.rcp/README~~ for further information about building instructions. 202 + 198 198 1.1 Troubleshooting 199 199 200 200 1.1.1 Dealing with Out-of-Memory Errors