IDE Settings and Debugging

Configuring Eclipse

Now the application is building you probably want to be able to develop and debug Apache Rave from inside Eclipse. This gives a faster turnaround in the edit/build/deploy cycle.

There are a few different ways to do this:

Using Remote debugging and the Eclipse FileSync plugin

The OSS Eclipse FileSync plugin can automatically synchronize (re)source changes (e.g. .jsp, .css, .js) made in the Eclipse IDE directly to the runtime tomcat deployment started (separately) through maven cargo:start. And you can attach the Eclipse debugger to the cargo started Tomcat instance (see above) as remote application on default port 8000.

The maven-filesync-plugin is pre-configured to generate default Eclipse FileSync configurations for the rave-shindig and rave-portal projects, mapping their source folders src/main/webapps and src/main/resources to synchronize (copy) changes to the Tomcat deployment environment under rave-portal/target/Tomcat6x, so this will work out-of-the-box.

Prerequisite: install the Eclipse FileSync plugin from its Update Site. You need to select plugin based on eclipse version. For Eclipse 3.7 select Eclipse 3.5 -3.7 plugins and Eclipse 3.6 -3.7 plugins(Bytecode outline)

The first time you build the Apache Rave project with maven, the maven-filesync-plugin will generate this default FileSync configuration for the FileSync plugin. Afterwards you only have to refresh the Eclipse projects once to have them recognize this. Thereafter you can customize the synchronization configuration manually within Eclipse through the project properties dialog. Note: manual changes will not be overridden anymore by the maven-filesync-plugin once they exist. Furthermore, if you are not using Eclipse, this plugin will simply skip its execution.

If you have "Build automatically" enabled within Eclipse, the FileSync plugin will synchronize changes automatically after you saved them in Eclipse. Otherwise you can force a manual synchronization from the project (rave-portal or rave-shindig) its context menu actions.

Using Eclipse WTP

The Apache Rave project can also be deployed through Eclipse WTP, and might be adequate for some, but it it is less functional and sometimes a bit quirky. Furthermore, because of (current) limitations of the m2eclipse WTP integration for maven war overlays (which the rave-shindig project uses), you'll need to use some workarounds to make it workable.

Prerequisite: Install m2eclipse-wtp integration from the m2eclipse-extras Update Site

If you already imported the Apache Rave projects in Eclipse, first remove them (but don't need to delete them) and then (re)import the Apache Rave project as Maven projects to get the m2eclipse-wtp integration enabled.

Then you need to follow these steps:

Now we need to add the the two webapps to a pre-setup (Tomcat 6) server:

Configuring Intellij

Configure remote Tomcat and Intellij

Debug with Intellij and remote tomcat

Note: to enable debugging session add following to catalina.sh file: "CATALINA_OPTS="${CATALINA_OPTS} -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"