How to set up an Eclipse dev environment for a custom overlay

Version 13

    My goals were fairly simple. I just wanted to get a project and be able to run/debug it all from within Eclipse. This document assumes you have set up your database and Jive home properly. It also assumes you have a custom overlay.

     

    What you need:

    Tomcat 6

    Eclipse (I used Galileo)

    Postgres (Other DBs should work too)

    Maven

     

    What to do:

     

    Setting up Maven:

    1. Add the Maven bin directory to your path so it's easily executable from the command line.
    2. Update your Maven settings.xml file to include the local repository. See Maven XML File for more info.

     

    Getting source code:

    1. Download the code from your repository into your Eclipse workspace directory (I called mine jive).
    2. Download the Jive SBS code for the version you want into your Eclipse workspace directory. You could get this from the Jive SVN repository or from the Jive Maven repository.

     

    Building with Maven:

    1. cd to the directory where you downloaded the project in step 1 of the previous section. There should be a pom.xml file in the root directory providing you used Maven for your project. Otherwise ignore this section and you'll have to figure out how to build based on what technology you're using.
    2. If it's a "Multiple Module Project" run mvn install
    3. From the command line run mvn eclipse:eclipse
    4. From the command line run mvn clean package

     

    Configuring Eclipse projects:

    1. Open Eclipse and open the workspace where you downloaded the code from your repository.
    2. Go to File -> Import. Choose General -> Existing projects into workspace. Select your workspace directory where you downloaded the code as your root directory. Select both projects and click Finish.

     

    Configuring the embedded Tomcat server in Eclipse:

    1. On the Servers tab right click and choose New -> Server
    2. Select Apache -> Tomcat 6 for your server type
    3. Add your Tomcat installation directory as the runtime environment and click Finish.
    4. Double click the server you just created in the Servers tab.
    5. Click the "Open launch configuration" link.
    6. Go to the "Arguments" tab and add -Xms256m -Xmx1024m -XX:MaxPermSize=192m to the VM arguments.
    7. Go to the "Source" tab and add your core and customer projects.
    8. Click Apply and Ok
    9. In the package explorer, open the server.xml file under Servers -> <The server you made>
    10. Right before the </HOST> tag add the line below. You have to change the docBase to where your "mvn clean package" command exploded the WAR.                                                                                                                                          
      <Context path="/<CONTEXT_NAME>" docBase="<PATH_TO_EXPLODED_WAR>"/>
      

    11. Restart Eclipse. I've noticed that when you change the server.xml file, Eclipse needs a restart to pick up the change.

     

    Comments:

    You should now be good to go. If you want to make code changes, just run "mvn clean package" and start/restart your embedded Tomcat server.