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) In addition OLAT uses its own Maven plugin (introduced to migrate specific OLAT Ant targets) and you can see what goals it supports by issuing:

mvn help:describe -Dplugin=olat

To simplify usage of this plugin (e.g., invocation using olat: prefix etc.) you will first need to define a plugin group in your Maven settings.xml file (on Linux systems this is found in the .m2 directory of your home account. This can be done by adding the following line to the pluginGroups element as indicated in the following sample file:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

<pluginGroups>
    <pluginGroup>org.olat.plugins</pluginGroup>
</pluginGroups>

</settings>

The following details some of the configuration parameters found in olat.local.properties that are of particular relevance to developers:

Table 2.3. Developer configuration properties

skip.db.installRequired only for installations and should be set to true for developers if the database is already present
skip.unit.testsMay be set to true for developers though we require periodic execution of all unit tests
unpack.fontsMay be set to false if you do not require the use of mathematical fonts and therefore do not wish them to be unpacked during the build.
eclipse.server.nameThe name of your WTP Tomcat Server as your configured it in Eclipse. Note that -config is appended to your server name on the filesystem by Eclipse - your entry here should not include this.
eclipse.server.port / eclipse.server.secure.portThe ports on which your Tomcat Server is configured to listen
eclipse.admin.portThe ports on which your Tomcat Server shutdown port is configured to listen
eclipse.ajp.portThe ports on which your Tomcat Server APJP connector is configured to listen (optional)
eclipse.server.keystore.*The PKCS#12 keystore settings for your Tomcat server if using SSL (optional)
eclipse.recreate.dirsIf set to true then application directories (e.g., userdata etc.) are removed with each build.
clean.plugin.clean.*If set to true then the relevant componet will be removed when the Maven olat:clean goal is issued (this goal is called automatically when you issue a Maven clean goal.) Specifically this concerns the dropping of the database, removal of application directories (e.g., userdata etc.) and removal of application logs.

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 -Pdeveloper package

Table 2.4. Common Build Goals

cleanRemoval of all generated and distributed assets. Depending on how you have set your olat.plugin.clean.* properties your database may be dropped and application and/or log directories removed.
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.

The following lists the common profiles you are likely to want to use (this require the -P option) Generally speaking profiles can be combined (e.g., developer and cluster)

Table 2.5. Common Build Profiles

NoneWhen no -P is present the build injects no specific features and creates standard build assets
developerEnsures that the WTP Tomcat server is appropriately configured and that specific developer practices and expectations are honoured.
clusterEnsures the OLAT cluster configuration (instead of the Single VM) is deployed