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. Also, it is assumed that you are using a unix-like shell for command line processing, if you are using the windows command line, replace the references to the shell scripts below with their aequivalent dos batch files (e.g. replace "build.sh" with "build.bat") and "/" with "\".

Depending on what you will be working on, you might need to import several projects into Eclipse. In this context, there are 3 types of projects: realms, resources, and Yanel itself.

Importing a realm

If you want to work on a realm that has a separate repository from the Yanel source, i.e. that is not one of the realms included with Yanel, follow these steps to import it as a project into Eclipse:

  1. Check out Yanel and the external realm, and add the realm to Yanel by following this example.
  2. Build an Eclipse project using the specific "eclipse" target with the realm's build file:
    {path/to/yanel/root}/build.sh -f {path/to/realm/root}/build.xml eclipse
  3. In Eclipse, select File -> Import, to 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 realm's root directory (i.e. where build.xml is located)
  6. Make sure the realm project is selected (should be the only one), "Copy projects into workspace" is not selected, and click on Finish.

The realm should now be visible as a project in Eclipse's Package Explorer.

Importing resource types

If you want to work on a specific resource type that is either a resource type of Yanel, or one belonging to another realm, follow these steps to import it as a project into Eclipse:

  1. Follow point #1 above if you have not already done so.
  2. If the resource type you are importing belongs to an external realm, follow point #2 above if you have not already done so.
  3. If the resource type you are importing belongs to Yanel, build an Eclipse project using the specific "eclipse" target with the resource's build file:
    {path/to/yanel/root}/build.sh -f {path/to/yanel/root}/build.xml eclipse
  4. In Eclipse, select File -> Import, to open the Import dialog.
  5. Select General -> Existing Projects into Workspace, then click on Next.
  6. Check "Select root directory", click on Browse, and select either "{path/to/realm}/res-types" (if you are importing an external realm's resources, they will be imported all at once) or the directory of the Yanel resource that you want to import ({path/to/yanel/root}/src/resources/{resource-to-import}, in this case you have to import them one by one).
  7. Select the resources that you want to import as projects, make sure "Copy projects into workspace" is not selected, and click on Finish.

The resources should now be visible as a projects in Eclipse's Package Explorer.

Importing Yanel

  1. Check out and build Yanel as usual, if you have not yet done so.
  2. Build an Eclipse project using the specific target "eclipse":
    {path/to/yanel/root}/build.sh eclipse
  3. In Eclipse, select File -> Import, to 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), "Copy projects into workspace" is not selected, and click on Finish.

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

Debugging

To start debugging with Eclipse, start Tomcat in debug mode:

{path/to/yanel/root}/local/apache-tomcat-5.5.20/bin/catalina.sh jpda start

Alternatively, you can (theoretically) also use the Eclipse Tomcat Launcher. If you succeed in this, please document it here.

Notes

Windows users, please configure your line endings as LF by setting Preferences -> General -> Workspace -> New text file line delimiter 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.