Building from sources

1 Overview

The community distribution of eXo Platform is built very frequently by the open source project members. The corresponding binaries are uploaded to the OW2 forge. Although the high frequency allows to get quick bug fixes, it might be needed sometimes to build eXo Platform from the sources. This page gives detailed instructions.

eXo Platform is built using a mix of Maven and JavaScript. Maven is used to compile and download the dependencies. JavaScript is used to package and deploy the project. We selected this language because it allows reflecting immediate changes in the build and because we wanted to reduce the number of languages used in the platform (JavaScript is already used to process AJAX requests). After you have built, you should go to the Developers page, where you find hints for the use with Ecplise and Intellij.

2 Create the exobuild base structure

  • Create a java directory on your filesystem. We will call this directory $EXO_BASE_DIRECTORY in the rest of this article. Default settings assume $HOME/java on Linux and Mac OS and D:\java on Windows
  • Download JDK (Java Development Kit) 5.0 and install it in $EXO_BASE_DIRECTORY/jdk1.5
  • Download Maven 2.0 and unzip it in $EXO_BASE_DIRECTORY/maven2
  • Create $EXO_BASE_DIRECTORY/exo-dependencies and $EXO_BASE_DIRECTORY/exo-working directories
  • Download your application server and extract it to $EXO_BASE_DIRECTORY/exo-dependencies. The name of the extracted directory should match the name given in the following table :
Application serverDownload siteVersion numberName of the directory
Apache Tomcathttp://tomcat.apache.org6.0+exo-dependencies/tomcat-${version}
JBoss AShttp://www.jboss.org4.2.0+exo-dependencies/jboss-${version}
OW2 JOnAShttp://jonas.objectweb.org4.8.4+exo-dependencies/jonas-${version}

The ${version} number can be specified in the exoenv script by the CLEAN_SERVER variable. See below in Configuration for more information on the exoenv script.

By the end you should have the following directory structure :

java/
  exo-dependencies/
    tomcat-${version}/
    jboss-${version}/
    jonas-${version}/
  exo-working/
  jdk1.5/
  maven2/

3 Check out the source code

eXo source code is hosted in a Subversion repository at http://svn.exoplatform.org/projects. Before you proceed, you need to install a command line subversion client.

Checkout the source code into $EXO_BASE_DIRECTORY/eXoProjects :

svn co http://svn.exoplatform.org/aliases/head eXoProjects

This will check out trunk for all project sources.

If you are interested you can also get all tags in one call :

svn co http://svn.exoplatform.org/projects eXoProjects

Alternatively, this page explains how you can check out a different subset of the main projects directory.

4 Instructions for Windows

4.1 Configuration

  • Copy $EXO_BASE_DIRECTORY\eXoProjects\tools\trunk\config\maven2\template-settings.xml to %HOMEDRIVE%\%HOMEPATH%\.m2 (example: C:\Documents and Settings\Smith\.m2). Rename the template-settings.xml you just copied to settings.xml. By doing this, the default maven settings in maven2/conf/settings.xml will be ignored.
  • Adapt the settings.xml to your environment by replacing the token @java.dir@ by the absolute location of $EXO_BASE_DIRECTORY. The value of localRepository now contains something like D:/java/exo-dependencies/repository.
  • Copy $EXO_BASE_DIRECTORY/eXoProjects/tools/trunk/build/src/main/resources/window/exoenv.bat to your $EXO_BASE_DIRECTORY
  • Edit the exoenv.bat file to adapt it to your environment. You should change the PORTABLE_DIR variable at the beginning, also adapt CLEAN_SERVER to your tomcat version. There are other handy variables available like JAVA_HOME (avoid a space like in "Progam Files" in JAVA_HOME, the use of "quotation marks" can cause problems later on).
  • Open a dos shell (Windows Start - Run - type "cmd" - ok) and run the following batch to setup the environment:
exoenv.bat

Continue the following step using this dos shell in order to keep the environment settings done by exoenv.bat.

4.2 Build and assemble the product

Build the product you need. For example :

exobuild --product=dms --version=2.3 --update --build --deploy
Please refer to Exo Build for more details/help on exobuild command.

4.3 Launch

  • Tomcat
  • Go to %EXO_BASE_DIRECTORY%\exo-working\exo-tomcat\bin directory
  • Make sure that the jvm option "-Duser.language=en" is set in "eXo.bat" file:
...
set JAVA_OPTS=-Xshare:auto -Xms128m -Xmx512m -Duser.language=en %LOG_OPTS% %SECURITY_OPTS% %EXO_OPTS% %EXO_LANGUAGE% %EXO_CONFIG_OPTS%
...
  • Run the command :
eXo.bat run

  • JBoss
  • Go to %EXO_BASE_DIRECTORY%\exo-working\exo-jboss\bin directory
  • Run the command :
    run.bat
  • Note: if you are also deploying DMS 2.5.x with Bonita as workflow, you need to use eXo.bat run to set some Bonita related environment variables automatically
  • JonAS 5 (not verified)
  • Go to %EXO_BASE_DIRECTORY%\exo-working\exo-tomcat\bin\unix directory
    • Adapt eXo.sh to your environment
  • Go to %EXO_BASE_DIRECTORY%\exo-working\exo-tomcat\bin directory and run the following commands :
copy unix\eXo.sh .

5 Instructions for Linux, Cygwin and Mac OS

5.1 Configuration

  • Copy $EXO_BASE_DIRECTORY/eXoProjects/tools/trunk/config/maven2/settings.xml to $HOME/.m2/settings.xml
  • Edit and adapt the settings.xml to your environment by replacing the tokens @java.dir@ by the absolute location of $EXO_BASE_DIRECTORY. By doing this, the default maven settings in maven2/conf/settings.xml will be ignored.
  • Copy $EXO_BASE_DIRECTORY/eXoProjects/tools/trunk/build/src/main/resources/linux/exoenv.sh to $EXO_BASE_DIRECTORY directory.
  • Edit exoenv.sh file to adapt it to your environment. You should only have to change the PORTABLE_DIR variable at the beginning but other handy variables are available like JAVA_HOME.
  • Run the command to setup the environment:
source exoenv.sh

To check that it has worked well, open the $EXO_BASE_DIRECTORY/maven2/conf/settings.xml and verify that the file corresponds with your environment, especially the definition of the repositories. Set thelocalRepository to the maven repository directory.

Example : /home/romain/Desktop/exoplatform/portail/exo-dependencies/repository

5.2 Build and assemble product

Build the product you need. For example :

exobuild --product=portal --update --build --deploy
Please refer to Exo Build for more details on exobuild command.

5.3 Launch

  • Tomcat
  • Go to $EXO_BASE_DIRECTORY/exo-working/exo-tomcat/bin directory
  • Change the rights on .sh files to make them executable :
    chmod +x ***.sh
  • Make sure that the jvm option "-Duser.language=en" is set in "eXo.bat" file:
...
EXO_OPTS="-Xshare:auto -Xms128m -Xmx512m -Dexo.product.developing=false -Duser.language=en"
...
  • Run the command :
    ./eXo.sh run
  • JBoss
  • Go to $EXO_BASE_DIRECTORY/exo-working/exo-jboss/bin directory
  • Change the rights on .sh files to make them executable :
    chmod +x ***.sh
  • Run the command :
    run.sh -c default
  • JOnAS 5
#info("Please see JOnAS wiki to find help on building eXo and JOnAS 5 !")

  • Go to $EXO_BASE_DIRECTORY/exo-working/exo-tomcat/bin/unix directory
    • Adapt eXo.sh to your environment
    • Change the rights on .sh files to make them executable :
      chmod +x ***.sh
  • Go to $EXO_BASE_DIRECTORY/exo-working/exo-tomcat/bin directory and run the following commands :
ln -s unix/eXo.sh
chmod +x eXo.sh jonas setenv unix/*.sh
  • Then start exo-jonas with start parameter with this command :
    /eXo.sh start

Creator: Brice Revenant on 05/26/2007
Copyright (c) 2000-2009. Allright reserved - eXo platform SAS
1.6.13286