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:
Eclipse (I used Galileo)
Postgres (Other DBs should work too)
What to do:
Setting up Maven:
- Add the Maven bin directory to your path so it's easily executable from the command line.
- Update your Maven settings.xml file to include the local repository. See Maven XML File for more info.
Getting source code:
- Download the code from your repository into your Eclipse workspace directory (I called mine jive).
- 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:
- 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.
- If it's a "Multiple Module Project" run mvn install
- From the command line run mvn eclipse:eclipse
- From the command line run mvn clean package
Configuring Eclipse projects:
- Open Eclipse and open the workspace where you downloaded the code from your repository.
- 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:
- On the Servers tab right click and choose New -> Server
- Select Apache -> Tomcat 6 for your server type
- Add your Tomcat installation directory as the runtime environment and click Finish.
- Double click the server you just created in the Servers tab.
- Click the "Open launch configuration" link.
- Go to the "Arguments" tab and add -Xms256m -Xmx1024m -XX:MaxPermSize=192m to the VM arguments.
- Go to the "Source" tab and add your core and customer projects.
- Click Apply and Ok
- In the package explorer, open the server.xml file under Servers -> <The server you made>
- 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>"/>
- Restart Eclipse. I've noticed that when you change the server.xml file, Eclipse needs a restart to pick up the change.
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.