directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Directory Wiki] Update of "IdeHome" by EmmanuelLecharny
Date Sun, 01 May 2005 23:40:00 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Directory Wiki" for change notification.

The following page has been changed by EmmanuelLecharny:

The comment on the change is:
Added a Eclipse howto.

New page:
= Using an IDE to compile/work with ApacheDS =

== preamble ==
First, you have to know that I'm french. Beside the fact that I'm arrogant, that I don't take
a shower every day, that I eat rotten cheese and a lot of garlic and snails - I'm french,
remember that -, my english is not as good as my french. If you feel the need to correct any
part of this text, you are welcome !

== Introduction ==

This page has been created as an help for those who want to use an IDE like Eclipse, Idea
or whatever IDE you like to build ApacheDS.

As you can see, there are not specific files that allow a user to directly import ApacheDS
in your favorite IDE. There are two reasons for this :
- there are many IDE on the market, and it's better not to constraint the project's members
to use one,
- we want to be sure that the project can be built every night using GUMP (hum), to allow
the community to fix a broken project as soon as possible.

However, ApacheDS community members are not using '''ed''' or '''vi''' or, even better '''emacs'''.
Those are good tools, and from time to time, it's good to handle those good old command lines.
But the power of a good IDE help us concentrate on programming.

== Basic setting ==

First, you have to be sure that your environment is correctly set. You have to be able to
compile ApacheDS without any error, and this is quite challenging, as you can see reading
the mail archive !

So here are the prerequisite :

=== OS ===
- a good operating system is needed. Call it Linux, Windows, OS-X, but at least choose a system
on which you can install a 1.4 JDK. OS/2 is not the winner in this category...

- You'll have to choose the OS on which you'll be able to install Eclipse or IDEA (or Netbeans,
or Jbuilder, who knows?). Be aware that if you want to profile your favorite program, there
will be some constraints.

- If you want to use Linux (welcome !), no problem. I'm personnaly enjoying '''Fedora core
3''' and '''Ubuntu 5.04'''. '''Ubuntu''' is really cool !

=== JDK ===

'''Sun''' or '''IBM''' JDK are equally good. I have better performance with IBM JDK, I don't
know why. Be sure to install the latest version, as many security issues has been corrected.
I'm using '''Sun JDK 1.4.2_08''' and '''IBM JDK 1.4.2''', both works well. I didn't had chance
to test the JRocket JDK, thaat would be interesting.

If you are a Linux user, the best solution is to install your JDK under /user/java. Linux
gurus may have better advices, so listen to them !

This project need a 1.4 JDK, it won't compile with a JDK 1.3 or 1.5 !!! (for 1.5 JDK, this
is just because there is a little problem with AOP; it will be fixed sooner or later)

=== Subversion ===

In order to check out the code, you will have to install a '''subversion''' client. Here is
the link :

Subversion is pretty well documented, so I won't add a lot of informations about it.

Check that the client is ok :

$ svn
Type 'svn help' for usage.

It seems that '''svn''' is installed !

=== Maven ===

Here we are! You'll have to be under the iron rule of Maven to build the project. If you can't
compile ApacheDS with Maven, then you are on the dark side of the Force.

So, download and install Maven 1.0.2. Install it wherever fits your need (I've installed it
under /home/java). Add a MAVEN_HOME environment variable :

Here is an extract of my .bashrc file on my Linux boc ('''.bashrc''' is the file you'll found
on you home directory)
export MAVEN_HOME=/home/java/maven-1.0.2 

'''Windows''' users, please set up your env using the correct sequence of left and right clicks...

Insure yourself that Maven is correctly installed by lauching it in a command window :

$ maven
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
Java : /usr/java/j2sdk1.4.2_08/bin/java :
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

Total time: 2 seconds
Finished at: Sun May 01 23:56:22 CEST 2005


(Good ! And the JVM is OK, too !)

=== Donwload the code ===

Very simple ! Create a working directory, and go there :

$ mkdir ApacheDS
$ cd ApacheDS
$ svn co
$ svn co
A  directory/LicenseBoilerPlate.txt
A  directory/trunks
A  directory/network
A  directory/network/trunk
A  directory/network/trunk/xdocs
A  directory/network/trunk/xdocs/roadmap.xml
A  directory/network/trunk/xdocs/index.xml
A  directory/network/trunk/xdocs/navigation.xml
A  directory/network/trunk/LICENSE.txt
A  directory/network/trunk/
A  directory/network/trunk/project.xml
A  directory/network/trunk/maven.xml
A  directory/network/trunk/src
A  directory/network/trunk/src/test
Checked out external at revision 165553.

Checked out revision 165553.

'''It takes time!!!''' Do NOT interrupt the process with a '''ctrl-c''', it does not work.
Either wait or kill the process. If you kill it, you will better clean the full directory
before retrying the command, there are a lot of meta-files created.

So have a coffee. Forget about your micro-wave oven, don't use instant cofee. You have plenty
of time !

=== First compilation ===

So far, so good. You have downloaded around 400 000 lines of code. You can check it by launching
the command '''''' under the sub-directory '''directory''' :

$ pwd
$ cd directory
$ ./ (sorry, windowers... please install Cygwin, it's really cool !)
lines of code in ./protocol-providers/ldap/trunk = 2084
lines of code in ./protocol-providers/dns/trunk = 4302
lines of code in ./protocol-providers/ntp/trunk = 1550
lines of code in ./protocol-providers/kerberos/trunk = 1996
lines of code in ./protocol-providers/changepw/trunk = 1514
lines of code in ./protocol-providers/dhcp/trunk = 4853
lines of code in ./clients/ldap/trunk = 10421
lines of code in ./clients/kerberos/trunk = 867
lines of code in ./sandbox/trunk = 53934
lines of code in ./sandbox/trunk/protocol/trunk = 583
lines of code in ./sandbox/trunk/apseda/trunk = 15176
lines of code in ./authx/trunk = 9386
lines of code in ./naming/trunk = 17227
lines of code in ./network/trunk = 19548
lines of code in ./shared/ldap/trunk = 85948
lines of code in ./shared/kerberos/trunk = 11215
lines of code in ./apacheds/trunk = 44946
lines of code in ./trunks/shared/ldap/trunk = 85948
lines of code in ./asn1/trunk = 26675
Total: 398173


Let's go for the first compilation ! You will have to be connected on Internet, because many
files will have to be downloaded by Maven (many Jakarta files).

'''To compile the project you ***MUST*** be in the main directory''', which is '''apacheds/trunk'''.

The command to type is '''maven multiproject:install'''. Don't ask my what it means, I don't
know ;-), at least, it compiles the whole stuff, and launch the tests.

$ pwd
$ cd apacheds/trunk/
$ pwd
$ maven multiproject:install
 maven multiproject:install
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
Java : /usr/java/j2sdk1.4.2_08/bin/java :
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2


    [echo] Gathering project list
Starting the reactor...
Our processing order:
ApacheDS Shared
ApacheDS Plugin
ApacheDS Core
ApacheDS Main

Tea time. Enjoy the pleasure of a Lapsang Soushong, you have to brew it for 5 minutes before
drinking it ...

Total time: 2 minutes 17 seconds
Finished at: Mon May 02 00:25:27 CEST 2005

Jeeze ! My computer is really fast ! ahhh. I know. I have all the downloaded files already
in my Maven repository. (400 000 lines of Java code compiled in 2 minutes. Who ever told that
Java was slow?)

== Using Eclipse IDE ==

Ok, so you basic environment is up and running. Time to Eclipse the command line, it seems.

=== Eclipse version ===

The latest, the best. Install the 3.0.2 version of eclipse (forget about the 3.1.M6, I don't
know if it works.)

Add an '''''' file in your eclipse root directory, to allow eclipse to
consume more memory :

$ more /opt/eclipse-3.0.2/ 
/opt/eclipse-3.0.2/eclipse -data $HOME/workspace-apacheDS -vm java -vmargs -Xmx750M

I like to 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.

I also added a directive to allow Java to use up to 750 M bytes of memory (I had Out of Memory
errors with the standard setting). 

Launch eclipse :

$ /opt/eclipse-3.0.2/ 

=== Eclipse plugins ===

Here are the plugins I personally use :

||Plugin name || role || external site ||version||
||subclipse||Subversion plugin||||0.9.30||
||mevenide||Maven plugin||||0.8.0||
||antlr|| Antlr plugin||||2.7.4||

Install all of them, you will need them.

You'll have to paramtrize those plugins.

==== Subclipse plugin ====

Here are the parameters I use :

Window --> Preferences --> Team --> SVN :


 * Note that I've checked the SVN command line, even if it's a beta version. (the javahl extension
does not work on linux yet)

Declare the svn repository by opening the SVN perspective, adding a new repository location:


 * This is an http access on the repository, it won't allow you to update your changes ! Don't
be afraid to make mistakes using svn, you will only harm yourself ;)
 * The user may be anonymous/anonymous, I don't remember. If you are a commiter, you must
type your user/password here, and change the previous http by https.

=== Importing projects ===

Now, you will have to '''check out as ...''' the following projects :

|| SVN path || Java project ||

You can forget about sandbow, sitedoces and trunks.

You will have many projetcs, and many compilation errors ! You have to create the sources
directory and set the dependencies.

=== .classpath ===

Here are the .classpath I use :


Copy those .classpath files in the correct sub-directories, refresh the perspective, it should
be OK.

'''THIS IS A DRAFT !!! Thanks to mail a comment to if you have any

== Using Idea IDE ==

Any IDEA user out there ?

View raw message