Insight Workspace Setup
Most Insight developers use Eclipse as their IDE for development. This document assumes the same and describes the workspace setup for Insight.
Before setting up your workspace, please download and install the following required software components:
- Java SDK 1.4.2 or higher
- Maven 2
- A suitable subversion client
- Preferred eclipse plug-ins. A list of useful plug-ins for insight development is listed in the eclipse-plugins.html page.
- NSIS - Nullsoft Install System
This document has been verified using the following versions of tools:
- Eclipse - 3.4M5
- Maven - 2.0.8
- Subclipse - 1.2.4
- M2Eclipse - 0.9.1.200803311600
- NSIS - 2.31
Checking out projects
You may checkout projects using either an external Subversion Client, like Tortoise SVN (not discussed here), or using the Subclipse eclipse plug-in.
If you decide to use Subclipse as your SVN client, open the SVN Repository view in either the SVN Repository Exploring perspective or the Java perspective and add the Insight Subversion URL as a repository. The URL to use would depend on your repository access mechanism. You can then browse the repository and check out the project(s) from the preferred trunk, branch or tag.
Checking out from outside Eclipse
If you decide to check out the project from outside your eclipse workspace, you may add the projects as eclipse projects using the maven eclipse:eclipse task as described on the Maven website at http://maven.apache.org/guides/mini/guide-ide-eclipse.html.
Mavenizing the Eclipse Projects
The dependencies for all the projects in Insight are defined using he maven pom.xml files for the projects, hence the easiest way to add classpath dependencies for the projects is to use maven.
If you have checked out the projects outside eclipse, the mvn eclipse:eclipse task should do this for you. However, every time the dependency of a project (or the version of a dependency) is changed, this task needs to be rerun to update the dependencies.
The easier way out is to use the Maven Integration for Eclipse plug-in. To enable the plug-in for a project, simply right click on the project, and in the context menu that comes up, select Maven > Enable Dependency Management. Since, we check in the .project files of our projects in the repository, if you have m2eclipse plug-in installed in your workspace, simply checking out the projects directly from eclipse should enable this feature for you.
Most of the Java compilation of the projects for testing should be automatically done by Eclipse if the Project > Build Automatically is set to true in Eclipse. However, maven builds and site generation for the project can be done in two ways; either using the m2eclipse plug-in (as described in the help documents of the plug-in) or using a command line mvn command.
Insight currently has a minimum Java Requirement of 1.4.2, and there is some code in Insight which will fail compilation with a higher Java Specification setting. So in your Eclipse project, please either use a 1.4.2 JDK or set the project compiler compliance level to 1.4
Insight UI Project
The Insight UI (insight/insight-ui) project requires some additional steps before developing in it.
Create a directory called config at the root of your project, and copy the insight-preferences.xml file from the src/main/config directory to the new directory. This will be the working configuration file for all debugging of Insight for your development environment.
Should you decide to make structural changes in this file, please make sure to make the same changes in the src/main/config/insight-preferences.xml file. The file under src/main/config is the one released with every build, so make sure not to add any sensitive data to that version of that file. Changes made to the file under src/main/config should be checked into the repository. Whereas, the file under config should never be chcked into the repository. Actually, the config directory under insight-ui project has been added to the svn:ignore list for that directory.
Running Insight UI from Eclipse
To run Insight UI from Eclipse either to test or debug, follow the steps:
- Right click on the checked out insight-ui project and in the context menu that comes up, select Properties. In the dialog box that comes up, select Resource on the left hand navigation, if not already selected. From the Resource pane select and copy the value of the Location property.
- Navigate down to the com.mindtree.techworks.insight.Insight class and right click. In the context menu that comes up, select Run As > Java Application.
- The first run will fail, as Insight will not be able to locate its INSIGHT_HOME property. So, go to Run > Run Configurations... on your eclipse workspace. Navigate down to the Insight UI run configuraiton and in the Arguments tab, put the following in the VM Arguments text area -DINSIGHT_HOME=location/selected/in/step/1.
Insight UI should now be available to be either run or debug from your workspace.