Title: IDE Settings and Debugging Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ## Configuring Eclipse * Install [Eclipse for Java EE][1] * Install M2Eclipse from: * [Indigo Update site if using Eclipse 3.7 (Indigo)][2] * [M2Eclipse Update Site if using Eclipse 3.6 or earlier][3] * Install eclipse plugin for [Subclipse][4]. Note: 1.8.x version have some missing library[02/22/2012] * Install Maven Integration for Subclipse * On Eclipse 3.7 or later see next step * On Eclipse 3.6 or earlier use the [M2Extras update site][5] * 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][6] 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][7] 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][8]. 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][10] 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 * Install [OpenJpa Enhancer integration plugin][11] Without this plugin you'll need to use maven for compiling. See also [plugin documentation][12] * Configure Remote Tomcat debugging configuration at port 8000 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" [1]: http://download.eclipse.org/webtools/downloads/ [2]: http://download.eclipse.org/releases/indigo/ [3]: http://www.eclipse.org/m2e/ [4]: http://subclipse.tigris.org/update_1.6.x/ [5]: http://m2eclipse.sonatype.org/sites/m2e-extras [6]: http://andrei.gmxhome.de/filesync/index.html [7]: http://code.google.com/p/mavenfilesync/ [8]: http://andrei.gmxhome.de/eclipse/ [9]: http://www.zeroturnaround.com/jrebel/how-to-install-jrebel-for-eclipse/ [10]: http://m2eclipse.sonatype.org/sites/m2e-extras [11]: http://plugins.intellij.net/plugin/?idea&id=6617 [12]: https://github.com/machak/enhancer/wiki