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>
Download OLAT or checkout from
the sources from the CVS repository of both olat3 and olatcore modules.
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!
Ensure that you are using the Sun JDK 1.6 or later and that your compiler has sufficient heap allocation (e.g., use -Xms1024m -Xmx1024m)
Make a copy of olat.local.properties.sample to olat.local.properties,
review and edit as appropriate. In particular set skip.db.install to true if
you have an existing database that you plan to use and review the developer section carefully and configure according to your needs.
Issue mvn -Pdeveloper eclipse:eclipse clean install
A local server deployment (accessible via Eclipse) will have been created during the build and can be used as your deployment target when you refresh your Eclipse workspace.
Access OLAT via http://tomcat_host:tomcat_port/olat using the username Administrator
and password olat.
If you change the olat.local.properties make sure you run mvn olat:properties to reflect this changes in the appropriate files and refresh your workspace after.
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.install | Required only for installations and should be set to true for developers if the database is already present |
skip.unit.tests | May be set to true for developers though we require periodic execution of all unit tests |
unpack.fonts | May 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.name | The 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.port | The ports on which your Tomcat Server is configured to listen |
eclipse.admin.port | The ports on which your Tomcat Server shutdown port is configured to listen |
eclipse.ajp.port | The 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.dirs | If 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
clean | Removal 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.
|
compile | Compilation of Java assets and distribution of related XML files, properties files and server configurations |
package | Packging 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.
|
test | Perform JUnit tests and generated a HTML based report. |
site | Generation 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
| None | When no -P is present the build injects no specific features and creates standard build assets |
developer | Ensures that the WTP Tomcat server is appropriately configured and that specific developer practices and expectations are honoured. |
cluster | Ensures the OLAT cluster configuration (instead of the Single VM) is deployed |