You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »

This page give some information about the layout of Apache DS 1.5 trunks, and try to explain how it is built.

Project Hierarchy

The actual project hierarchy is the following :

  • apacheds
    • bootstrap-extract</module>
    • bootstrap-partition</module>
    • bootstrap-plugin</module>
    • schema-extras</module>
    • schema-bootstrap</module>
    • utils
    • schema-registries
    • jdbm-store
    • constants
    • btree-base
    • core
    • core-shared
    • core-plugin
    • core-unit
    • protocol-shared
    • protocol-ntp
    • protocol-ldap
    • protocol-kerberos
    • protocol-dhcp
    • protocol-dns
    • protocol-changepw
    • server-tools
    • server-unit
    • server-main
    • server-jndi
    • kerberos-shared
    • mitosis
    • server-replication
    • server-ssl
  • shared
    • asn1
    • ldap
    • ldap-constants
    • asn1-codec
    • convert
  • daemon
    • bootstrappers
    • plugin

This hierarchy represent the projects being built. Some project (OSGI, ...) are not built

Prerequisites for building

You must have installed Maven 2.0.7 and have a JDK 5 installed on your computer. A working internet connection is also mandatory.

Maven

Download and install Maven 2.0.7. (ATTENTION !!! Do NOT use another version of Maven )

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-2.0.7
export PATH=$JAVA_HOME:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
...

Windows users, use Control Panel -> System -> Advanced -> Environment Variables

JDK 5

Sun JDK

There may be some issues with older JDK versions and Kerberos, therefore we recommend using a version >=1.5.0_09

Getting the code

To download the sources, 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

Building the trunks

Enabling Snapshot Repositories

The following information is only needed if one want to setup its own maven repo. There is no need to define a settings.xml file for generic usage.
Before building the trunks, you must configure Maven 2 to use the snapshot repository for Apache. Snapshot repositories are typically configured per user at ~/.m2/settings.xml. The following example, added to your settings.xml, will add a profile for the Apache snapshot repository.

<settings>
  <profiles>
    ...
    <profile>
      <id>apache</id>
      <repositories>
        <repository>
          <id>apache.org</id>
          <name>Maven Snapshots</name>
          <url>http://people.apache.org/repo/m2-snapshot-repository</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>apache.org</id>
          <name>Maven Plugin Snapshots</name>
          <url>http://people.apache.org/repo/m2-snapshot-repository</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    ...
  </profiles>
</settings>

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)>]

To specify the 'apache' profile to always be active:

<settings>
  ...
  <activeProfiles>
    <activeProfile>apache</activeProfile>
  </activeProfiles>
  ...
</settings>

 Building the trunks

If you already have built the trunks once, it may be better to clean the repository :

cd <root of apache directory server sources>
mvn clean

Now, we can compile the project.

The command is simple :

cd <root of apache directory server sources>
mvn 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] ------------------------------------------------------------------------

If you want to do really safe build, run the following commands in trunks:

resources/superclean.sh
mvn install
mvn -Dintegration test

Building the installers

Building the installers is a two phase process :

cd <root of apache directory server sources>
mvn install
cd apacheds/server-installers
mvn install

That's it, the jars will be find in target/images/apacheds-1.5.0-SNAPSHOT-<XXXXXX>-setup.jar where XXXXXX is your local system

Starting the server without installation

The directory apacheds/server-main 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/server-main
./apacheds.sh

Integration test

To run integration tests, just use the following command :

cd <root of apache directory server sources>
mvn -Dintegration test

Eclipse

Building eclipse files

To build the .project and .classpath files for eclipse, type the following commands :

cd <root of apache directory server sources>
mvn clean install
mvn eclipse:eclipse

then import all the existing project which has been created.

Maven settings

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

Eclipse hints

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

Eclipse plugins

Coding standards

The coding standards including an eclipse code formatting profile is available here.

.

  • No labels