This page give some information about the layout of Apache DS 2.0 trunks, and try to explain how it is built.
{{% toc %}}
The server is a composition of many projects, which should be built in a given order, assuming you want to build the trunk. This order is enforced by a top level pom, so you don't need to take care of this at all.
We will expose the projects hierarchy, just for information.
We first have a meta-project, which contains mainly information about the maven plugins we use. This meta-project is used by all the real projects. This project has one single module :
This project is used to define the checkstyle configuration we use when we generate the reports.
It has one single module :
Dependencies : project
This project is used to add concurrent tests in the server. It's a fork of [Mycila](ref needed).
It has one single module :
Dependencies : project
This project contains all the common LDAP structures that are used by ApacheDS, Apache Studio and the Apache LDAP API. In fact, this is the Apache LDAP API (even if we do have slightly more than necessary for an LDAP API).
This project depends on ‘project’.
Here is its hierarchy :
Dependencies : project, junit-addons
This project covers the JDBM code. It's a fork of the [JDBM 1.0 project](ref needed).
The current project hierarchy is the following :
Dependencies : project, junit-addons
This project is the server itself. It depends on ‘project’, ‘shared’ and ‘jdbm’.
The current project hierarchy is the following (as of 2.0.0-M9-SNAPSHOT) :
Dependencies : project, junit-addons jdbm, shared,
You must have installed Maven 3.0.4 and have a JDK 5 (or a more recent one) installed on your computer. A working internet connection is also mandatory, unless you have all the needed dependences and plugins loaded locally.
For Linux:
MAVEN_OPTS=“-Xmx256m” mvn clean install
For Windows:
SET MAVEN_OPTS="-Xmx256m" mvn clean install
Download and install Maven 3.0.4.
Add a MAVEN_HOME environment variable and add MAVEN_HOME/bin to your system path:
On a Linux box you could add the following to the .bashrc file (.bashrc is a file you'll find in your home directory)
... export MAVEN_HOME=/opt/maven-3.0.4 export PATH=$JAVA_HOME:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH ...
Windows users, use Control Panel -> System -> Advanced -> Environment Variables
Any newer version should also work.
To download the sources from trunk, you must have installed a Subversion client.
With readonly access :
svn co http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies apacheds-trunk
With read/write access (for committers only) :
svn co https://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies apacheds-trunk
You may either specify the profile at the command-line, each time you use ‘mvn’, or you may configure the profile to always be active.
To use a profile at the command-line:
# mvn -Papache [options] [<goal(s)>] [<phase(s)>]
Now, we can compile the projects.
The command is simple :
cd apacheds-trunk mvn clean install
A lot of plugins will be downloaded. If you are curious, you can then look at .m2/repository to see what has been downloaded on this step. Building should finish with these lines:
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8 minutes 30 seconds [INFO] Finished at: Mon Oct 30 23:32:41 CET 2006 [INFO] Final Memory: 18M/32M [INFO] ------------------------------------------------------------------------
resources/superclean.sh mvn install -Dintegration
The server can be run without building any installers. This is helpful during development (and also can be run for regular purpose as well)
cd apacheds-trunk/apacheds/service ./apacheds.sh
To start the server in remote debug mode pass -debug flag. The JDWP socket will be listening on port 8008.
Building the installers is a two phase process :
cd apacheds-trunk mvn -Pinstallers install
That's it, the jars will be find in target/images/apacheds-2.0.0-M?-SNAPSHOT--setup.jar where XXXXXX is your local system and M? is the milestone release number for the 2.0 branch.
The directory apacheds-trunk/installers/apacheds-noarch contains a script for Linux (apacheds.sh) and one for Windows (apacheds.bat) which can be used for starting the server without the need to install it first (as non-root-user on Linux and non-Windows-service on Windows).
Linux:
cd apacheds-trunk/installers/apacheds-noarch ./apacheds.sh
As Apache Studio is an Eclipse plugin/RCP application, we use extensively this IDE. Of course, you can use another IDE.
To build the .project and .classpath files for eclipse, type the following commands :
cd apacheds-trunk mvn eclipse:eclipse
Don't forget to declare a classpath variable named M2_REPO, pointing to ~/.m2/repository, otherwise many links to existing jars will be broken.
You can declare new variables in Eclipse in Windows -> Preferences... and selecting Java -> Build Path -> Classpath Variables
Add an eclipse-apacheDS.sh file in your eclipse root directory, to allow eclipse to get more memory (e.g. 750MB) You may also declare a specific workspace when launching eclipse. I have created a workspace-apacheDS directory in my HOME directory, where all the ApacheDS project is built when I use Eclipse.
<eclipse_root>/eclipse -data $HOME/workspace-apacheDS -vm java -vmargs -Xmx750M
Launch eclipse :
<eclipse_root>/eclipse-apacheDS.sh
The coding standards including an eclipse code formatting profile is available here