2.3. Developer Installation

This section describes the installation process for developers working on OLAT code. Please ensure that you have already installed the necessary prerequisites as described in Section 2.1, “Prerequisites” and that these are functioning correctly.

Throughout we assume that you are working with Eclipse and have the Web Tools Platform (WTP) and Concurrent Version Systems (CVS) support installed. We have found that it is best to install WTP when packaged with Eclipse (e.g., by downloading the Eclipse IDE for Java Developers) rather than attempt to install WTP to an existing Eclipse installation.

Maven is the build tool used by OLAT and we encourage you to become familar with it (you may be interested to know that the Maven: The Complete Reference is available online)

Step by Step Development Installation :

  1. perform fresh checkout from cvs (not simply cvs-update) of olat3 and olatcore (use a new workspace if you have this folders already in your workspace)

    Important

    Note that when you rename olatcore to something else, you manually have to adjust the path to olatcore in the modules section in olat3/pom.xml!

  2. In Terminal: make sure that you are using maven 2.2 or higher (mvn -V)

  3. In Terminal: go to olat3 directory

  4. In Terminal: create eclipse project settings and creates .classpath files

    mvn eclipse:eclipse, mvn install (installs copies all jars and resources to the target folder). If you run out of memory while runnig this commant set MAVEN_OPTS="-Xmx1024m" in front of the mvn command.

  5. In Eclipse: refresh ola3 and olatcore projects

  6. In Eclipse: setup tomcat server by clicking on olat3->Run As->Run on Server->Manually define a new server

  7. In Eclipse: under Servers find your server and change content of the server.xml to:

    <?xml version="1.0" encoding="UTF-8"?>
      <Server port="8005" shutdown="SHUTDOWN">
        <Service name="Catalina">
          <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
          <Connector port="8080"/>
          <Engine defaultHost="localhost" name="Catalina">
            <Host appBase="webapps" name="localhost">
              <Context path="/olat" docBase="/yourhome/workspace/olat3/olat/target/olat" debug="0" reloadable="false" >
              </Context>
            </Host>
          </Engine>
        </Service>
      </Server>
                

  8. (optional) In Eclipse: setup VM arguments by clicking on olat3->Run Configurations->Arguments->VM Arguments and pasting:

    -Djava.io.tmpdir="/tmp/olatdata" -Xmx512m -Xms512m

  9. In Eclipse link the core sources (olatcore/src/main/java) and core resources (olatcore/src/main\resources) to olat3 project. Go to olat3->Properties->Java Build Path->Source->Edit the two path entries to your env.

  10. Before you start create an empty olat.local.properties and save it to /yourTomcatDir/lib (OLAT searches for this file on the classpath and /tomcat/lib is part of it). But OLAT should start with just the default config!

  11. Usually you will get a timeout exception when you start a new OLAT. After double clicking on the server entry you can increase the timeout for the startup.

  12. (not needed normally). If your tomcat starts very quickly but you cannnot access OLAT it might be that tomcat did not find the OLAT context. Right click the server entry and click publish to inform eclipse about a new context.

Background (optional for further interest) :

For OLAT configuration see olat.properties. You can overwrite each property in your olat.local.properties.

The following are the most frequently used Maven goals. Generally speaking for normal development it suffices to invoke compile or package under the developer profile i.e.,

mvn package

Table 2.3. Common Build Goals

cleanRemoval of all generated and distributed assets. Remove application and log directories.
compileCompilation of Java assets and distribution of related XML files, properties files and server configurations
packagePackging of all compiled and distributed assets into your local deployment target (as an aside a WAR is also generated.)
install Sets up the database (depending on your database properties) and places generated assets in your local repository (i.e., where your M2_REPO points to) If you are only interested in invoking this target in order to install the database then you can do so directly by issuing the olat:dbinstall goal.
testPerform JUnit tests and generated a HTML based report.
siteGeneration of a website, found under olat/target/site, including extensive information of interest to developers (e.g., output of static code analysers, project information etc.) Be advised that this target takes a while to complete.