Setting up Yanel in the Eclipse IDE

This document will get you started using Eclipse to develop/debug Yanel. To keep things simple and reliable, building and SVN access will be done outside of Eclipse.

Importing the Yanel core

  1. Check out and build Yanel as usual.
  2. Build an Eclipse project using the specific target "eclipse":
    {Yanel-Root}/build.sh eclipse
  3. In Eclipse, select File -> Import, this will open the Import dialog.
  4. Select General -> Existing Projects into Workspace, then click on Next.
  5. Check "Select root directory", click on Browse, and select the Yanel root directory (i.e. where build.sh is located)
  6. Make sure the Yanel project is selected (should be the only one), and "Copy projects into workspace" is not selected, and click on Finish.

The project "yanel" should now be visible in the Package Explorer.

Importing external realms

Realms that have a separate repository from the Yanel source can be imported as additional projects.

 

 

 

Project setup
Create new Java Project in Eclipse workspace. Use the option "Create project from existing source".
BUILD
To build yanel, use ./build.sh in the console. Make sure Option "Build Automatically" is turned off in Eclipse. alternative: one can also use the "run external tools" to build inside eclipse. which is handy because you don't have to switch between shell and eclipse. Go to the menu Run -> External Tools -> Open External Tools Dialog... click "new Lanuch Configuration" to add a new launcher. In the main tab choose the build.xml of your yanel. (e.g. ${workspace_loc:/yanel-projects/src/build/build.xml}). Choose the target which you want to configure on the targets-tab. IMPORTANT: choose the target before you set the ant-home (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=143008#c6). On the classpath tab add the ant shipped with yanel as ant-home.
CLASSPATH
Add libraries to classpath of the project. The libraries are located in $ECLIPSE_WORKSPACE$/yanel-trunk/local/apache-tomcat-5.5.20/webapps/yanel/WEB-INF/lib. Add all libraries except the ones starting with yanel-*.
CORRECT
Eclipse import source wizzard mixes up something with src/resources/testing-times/src. Remove this folder from build path and add src/resources/testing-times/src/java. Perform project cleanup.
DEBUG
Use the Eclipse Tomcat Lanucher (http://www.eclipsetotale.com/tomcatPlugin.html) which registers Tomcat process to Eclipse debugger.
To debug Resources of a project, set a breakpoint in a resource. Eclipse will not find the source of the resource automatically. After it fails the first time you can use the button displayed "attach source" and then attach the whole resource folder of a realm.

also set in the log4j.properties the ConsoleAppender insted of the RollingFileAppender

    log4j.appender.A1=org.apache.log4j.ConsoleAppender 
    #log4j.appender.A1 = org.apache.log4j.RollingFileAppender 
    #log4j.appender.A1.File = /home/simon/src/yanel-projects/build/logs/log4j-cnode1.log
    
this way you can see the output of the logging in the eclipse console.
Other projects depending on Yanel
To develop projects depending on yanel, like "Yanel contributions", add yanel-trunk as project dependency to this project.
For Windows user:
The files should have LF as end character. Menu: Window -> Preferences -> General -> Workspace -> New text file line delimiter. Set to "Unix".


Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.