directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Directory Wiki] Update of "IdeHome" by CKoppelt
Date Sun, 04 Feb 2007 19:35:39 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 CKoppelt:
http://wiki.apache.org/directory/IdeHome

------------------------------------------------------------------------------
- = Using an IDE to compile/work with ApacheDS =
+ deleted
  
- 
- == Table Of Contents ==
- [[TableOfContents]]
- 
- == 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 focus on programming.
- 
- == Basic settings ==
- 
- First, you have to make sure that your environment is correctly set. You have to be able
to compile ApacheDS without any error.
- 
- So here are the prerequisites :
- 
- === 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.5 JDK (1.5 is mandatory). 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.
- 
- === JDK ===
- 
- The correct version to use is a JDK 5.0, as it's needed for '''MINA''' ( one of the sub-project
).
- 
- The version to use is probably the last one : '''JDK 5.0 update 7''', if you use Sun(tm)
JVM. Install it.
- 
- If you are a Linux user, the best solution is to install your JDK under /usr/java. Linux
gurus may have better advices, so listen to them !
- 
- === Subversion ===
- 
- In order to check out the code, you will have to install a '''subversion''' client. Here
is the link : http://subversion.tigris.org/project_packages.html
- 
- Subversion is pretty well documented, so I won't add a lot of information about it.
- 
- Check that the client is ok :
- 
- {{{
- $ svn
- Type 'svn help' for usage.
- $ 
- }}}
- 
- It seems that '''svn''' is installed !
- 
- === Maven ===
- 
- We use Maven 2.0 to build the project
- 
- So, download and install Maven 2.0.4. ( <!> ATTENTION !!! Do *NOT* use another version
of Maven ) 
- 
- Install it wherever it fits your need (I've installed it under /opt/maven-2.0.4). Add a
MAVEN_HOME environment variable :
- 
- Here is an extract of my .bashrc file on my Linux box ('''.bashrc''' is the file you'll
find in your home directory)
- {{{
- ...
- export MAVEN_HOME=/opt/maven-2.0.4
- export PATH=$JAVA_HOME:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
- ...
- }}}
- 
- '''Windows''' users, use Control Panel / System / Advanced / Environment Variables
- 
- Make sure that Maven is correctly installed by running it in the console:
- 
- {{{
- $ mvn
- [INFO] Scanning for projects...
- [INFO] ------------------------------------------------------------------------
- [ERROR] BUILD FAILURE
- [INFO] ------------------------------------------------------------------------
- [INFO] You must specify at least one goal. Try 'install'
- [INFO] ------------------------------------------------------------------------
- [INFO] For more information, run Maven with the -e switch
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: < 1 second
- [INFO] Finished at: Sat Jun 24 10:19:22 CEST 2006
- [INFO] Final Memory: 1M/2M
- [INFO] ------------------------------------------------------------------------
- $
- }}}
- 
- (Sorry, I don't know how to get the current version of Maven from command line ...)
- 
- === Donwload the code ===
- 
- Very simple ! Create a working directory, and go there :
- 
- {{{
- $ mkdir ApacheDS
- $ cd ApacheDS
- $ svn co http://svn.apache.org/repos/asf/directory/trunks
- ...
- $
- }}}
- 
- '''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 be better cleaning up the 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 coffee. You have
plenty of time (10 minutes at least) !
- 
- === First compilation ===
- 
- So far, so good. You have downloaded around 400 000 lines of code. 
- 
- Let's go for the first compile session ! You have to be online as many dependencies need
to be downloaded by Maven (many Jakarta components).
- 
- '''To compile the project you ***MUST*** be in the main directory'''.
- 
- The command to type is '''mvn install'''.
- 
- You may want to start with a '''mvn clean''' if you already have compiled the server pnce.
- 
- Compilation may take a while (10 minutes if your repository is empty)
- 
- When it's done, you ca also launch the tests :
- 
- '''mvn test''' for simple tests
- '''mvn -Dintegration test''' for integration tests
- 
- == Using Eclipse IDE ==
- 
- Ok, so your basic environment is up and running. Time to ''Eclipse'' the command line, it
seems.
- 
- First, we will build the projects file needed by eclipse : .projects and .classpath :
- 
- '''mvn eclipse:eclipse'''
- 
- === Eclipse version ===
- 
- Last but not least. Install Eclipse 3.x.0 (On Linux, I'm installing it in /opt. Windows
afficionados, do wathever you want !)
- 
- Add an '''eclipse-apacheDS.sh''' file in your eclipse root directory, to allow eclipse to
get more memory :
- 
- {{{
- $ more /opt/eclipse/eclipse-apacheDS.sh 
- /opt/eclipse/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 750MB of memory (I had Out of Memory
errors with the standard setting). 
- 
- Launch eclipse :
- 
- {{{
- $ /opt/eclipse/eclipse-apacheDS.sh 
- ...
- }}}
- 
- === Eclipse plugins ===
- 
- Here are the plugins I personally use :
- 
- ||<:#CCCCCC> '''Plugin name'''||<:#CCCCCC> '''role'''||<:#CCCCCC> '''external
site'''||<:#CCCCCC> '''version'''||
- ||subclipse||Subversion plugin||http://subclipse.tigris.org/update||0.9.37||
- ||antlr|| Antlr plugin||http://antlreclipse.sourceforge.net/updates||2.7.6.b2||
- 
- <!> do *NOT* use '''mevenide''' plugin. Even if this is quite a good plugin, it has
side effects on your project.xml files when you modify them. As a rule of thumb, generally,
do *'''NOT'''* modify project.xml files ;-)
- 
- Install them.
- 
- You'll have to set up those plugins.
- 
- ==== Subclipse plugin ====
- 
- Here are the parameters I use :
- 
- {{{
- Window --> Preferences --> Team --> SVN :
- }}}
- 
- attachment:svn-prefs1.png
- 
-  * 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:
- 
- attachment:svn-repo.png
- 
-  * 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/<nothing>. If you are a committer, you must type your
user/password here, and change the previous http by https.
- 
- ==== Maven settings ====
- You will have to declare an ''Eclipse'' variable : '''M2_REPO'''. This will be used to point
to the used jars by projects.
- 
- You can declare new variables in ''Eclipse'' in '''_W_indows -> _P_references...''' and
selecting '''Java -> Build Path -> Classpath Variables''' :
- 
- attachment:MAVEN_REPO_adding.png
- 
- Add the '''M2_REPO''' variable : 
- 
- attachment:MAVEN_REPO_value.png
- 
- That's it !
- 
- === Importing projects ===
- Just import all the projects into your eclipse perspective. It's really simple.
- 
- ==== Code formatting ====
- 
- An eclipse code formatting profile is available at [http://svn.apache.org/viewcvs.cgi/*checkout*/directory/trunks/resources/formatting.xml].
- 
- ==== Committer special ====
- The best solution will be to check out the whole code base on a specific directory, which
'''must''' not be a subdirectory of your workspace. You will then create all the needed projects
from this directory
- 
- == Using Idea IDE ==
- 
- Any IDEA user out there ?
- 

Mime
View raw message