Overview
This documents how to build Apache Geronimo. This guide is intended to cover how to build the latest server/trunk
, though these same instructions closely resemble instructions for building server/branches/1.2
. Older versions of Geronimo do not use Maven 2 and this instructions do not apply for them.
Prerequisites
- JDK 5.0+ (J2SE 1.5.0+)
- Apache Maven (2.0.5+)
- Subversion (1.2+)
Windows Tip
Windows users are strongly encouraged to change the M2 local repository (the place where dependencies are downloaded) to a shorter path with no spaces, e.g. C:\.m2
.
Using a longer path may cause the build (and Geronimo itself) to behave very strangely when it hits the 260 char limit for filenames on Windows.
In order to change the m2 local repository go to %USERPROFILE%/.m2 and edit/create settings.xml
file to contain the following content:
<?xml version="1.0"?> <settings> <localRepository>C:\.m2</localRepository> </settings>
Checkout Geronimo
svn co https://svn.apache.org/repos/asf/geronimo/server/trunk server
Windows Tip
Windows users are strongly encouraged to checkout Geronimo into c:\g
.
Using a longer path may cause the build (and Geronimo itself) to behave very strangely when it hits the 260 char limit for filenames on Windows.
Advanced users may proceed to the For Advanced Users section.
Preparing to build for the first time
Chances are you will need to increase the heap size for Maven. Add the following lines to ~/.mavenrc
:
The following snips only set MAVEN_OPTS
if its not already set, so that you can override these values on the command line if needed.
# Increase the heap size Maven if [ "x$MAVEN_OPTS" = "x" ]; then MAVEN_OPTS=-Xmx512m fi
If you are using the SUN JDK, you may also need to increase the maximum permanent size as well as the heap:
# Increase the heap and max permanent size for Maven if [ "x$MAVEN_OPTS" = "x" ]; then MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" fi
Windows Tip
Windows users should create mavenrc_pre.bat
under c:\documents and settings\<username>\mavenrc_pre.bat
or c:\mavenrc_pre.bat
depending on how the %HOME%
property is set on your system.
Variables will need to use the batch set syntax:
set <VARIABLE>=<VALUE>
Building
To build all changes incrementally:
mvn install
To perform clean builds, which are sometimes needed after some changes to the source tree:
mvn clean install
Building Stages
In some cases you may need to build Geronimo in stages, such as when building OpenEJB from source to pick up local changes. Most users will not need to do this, but its documented here for clarity.
To build modules, testsupport and maven-plugins:
mvn install -Dstage=bootstrap
To build apps, configs and assemblies:
mvn install -Dstage=assemble
Testing the assembly
Use the geronimo-maven-plugin
to start the server:
mvn -Ptools geronimo:start
Windows Tip
Windows users may need to specify an alternative installDirectory
to avoid long path problems:
mvn -Ptools geronimo:start -DinstallDirectory=c:\g
And to stop, either CTRL-C
or from a separate terminal:
mvn -Ptools geronimo:stop