Install Guide - Build (2.4)

3. Build and Deploy

Sakai uses Apache's Maven build tool to compile and deploy its modules.

How Sakai uses Maven

The steps below are limited to what you need to get started, but you may feel the need to learn more about how Sakai uses Maven. To find the most detailed such documentation, look for sakai_maven.doc in reference/docs/architecture of the source archive or on subversion at: https://source.sakaiproject.org/svn/reference/tags/sakai_2-4-1/docs/architecture/sakai_maven.doc

3.1. Download Source

If you haven't yet, download the Source archive from http://www.sakaiproject.org/release

Getting the Code from Subversion

Alternatively, you may check out the source code from subversion. You might wish to do this, for example, in order to grab the maintenance branch, which will include the latest set of bug fixes. You'll need to be sure to install a subversion client in order to do so, which can be found at:

http://subversion.tigris.org/project_packages.html

If you're on a Windows platform we'd recommend taking a look at TortoiseSVN. If you're working with Eclipse, you might want to take a look at the Subclipse plugin.

Once you have your subversion client installed, you can check out the maintenance branch without the versioning data with the following command:

svn export https://source.sakaiproject.org/svn/sakai/branches/sakai_2-4-x/

In which case you could skip the unpacking step below, and your root directory would be sakai_2-4-x instead of sakai-src.

3.2. Unpack Source

Choose a location to unpack the Sakai source (your home directory is fine), and when you unpack it you will see a directory named sakai-src.

3.3. Run Maven

From within the sakai-src directory, run the command

maven bld dpl
Subsequent builds


Subsequent builds would be advised to add the "clean" phase by using the command maven cln bld dpl, or the equivalent shortcut: maven sakai. See the sakai_maven.doc for more details.

This will run for quite a few minutes with fairly verbose output, particularly when it's your first build. Maven will download any dependencies into the local repository, compile the Sakai code, and then deploy Sakai to Tomcat in the form of .war files in the $CATALINA_HOME/webapps directory. If Maven completes with the message BUILD SUCCESSFUL, you should be able to move on to the next step. If you are greeted with the report BUILD FAILED read the accompanying error message carefully to troubleshoot (see the Troubleshooting section).

Maven and Memory

You may find that your machine runs out of memory while it is building Sakai. As it turns out, maven does not read JAVA_OPTS when it starts up, and so if your build output complains of "Out of Memory" errors you'll need to set an additional environment variable, namely, MAVEN_OPTS. The value in the sample Unix command below should be more than enough:

export MAVEN_OPTS="-Xmx384m -XX:PermSize=48m"

You will probably be able to start up Tomcat and run Sakai with the default configuration at this point, but it would be better to take care of some basic post-installation configuration first.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 14, 2007

    Li Qing says:

    Be sure to palce build.property to the root of source code folder. or start mave...

    Be sure to palce build.property to the root of source code folder.
    or start maven with parameters
    maven bld dpl -Dmaven.repo.remote=http://source.sakaiproject.org/maven/ -Dmaven.tomcat.home=c:/sakai/

    1. Sep 09, 2007

      Clay Fenlason says:

      build.properties doesn't need to be at the root of the source folder; it's easie...

      build.properties doesn't need to be at the root of the source folder; it's easiest to just have it in your home directory, as indicated on the "Set Up Build Environment" section.