Configuring Eclipse

  • Install Eclipse for Java EE
  • Install M2Eclipse from:
  • Install eclipse plugin for Subclipse. Note: 1.8.x version have some missing library[02/22/2012]
  • Install Maven Integration for Subclipse
  • File -> Import -> Maven -> Check Out maven project from SCM
    • If using Eclipse 3.7 or later you first need to install Maven Integration for Subclipse
    • Check "m2e Marketplace" select "m2e-subclipse"
    • Click "Finish"
    • Follow the installer
    • select SVN
    • URL for anonymous access is http://svn.apache.org/repos/asf/rave/trunk
    • URL for developer access is https://svn.apache.org/repos/asf/rave/trunk
  • Ensure rave-portal is building without errors
    • you may need to update dependencies first
  • With m2eclipse you can configure it to automatically resolve (download) missing dependencies if you have set Eclipse Preferences/Maven/Offline to false (unchecked), which should be the default. We recommend you always set that preference to true (checked) as this one specific feature of m2eclipse is often a performance drain (Update Maven projects on startup being the other).

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:run. 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:

  • Right click on the rave-shindig project and select Properties
  • Open the "Deployment Assembly" property
  • Press Add, select Directive Type "Folder", and select the target/rave-shindig--SNAPSHOT folder. (do a "mvn install" in rave-project first for this folder to be available)
  • configure the correct Context root paths for rave-portal ("portal") and rave-shindig ("/") in their Eclipse project properties under "Web Project Settings"

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

  • Windows->Show View->Other...
  • Server->Servers
  • OK
  • In the servers view right click your chosen server and slect Add and Remove...
  • Add rave-shindig and rave-portal
  • Start the server
  • Now see the instructions above for logging into the server

Configuring Intellij

  • Checkout Apache Rave project
  • File > New project > Import project from external model and select pom.xml

Configure remote Tomcat and Intellij

  • Go to Project Structure and select Artifacts
  • Add new artifact of type "Other"
  • Give above created artifact useful name e.g. "Portal" and point output directory to "CATALINA_HOME/webapps/portal"
  • Check "Build on make checkbox" and add copy of Artifact "rave-portal:war exploded to "output root"
  • Repeat above steps for Shindig artifact (use "rave-shindig:war exploded" artifact and use "CATALINA_HOME/webapps/ROOT" as output directory
  • Repeat above steps for Gadgets artifact (use "rave-demo-gadgets:war exploded" artifact and use "CATALINA_HOME/webapps/gadgets" as output directory

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"