Overview

This document will help new developers setup their Eclipse development environment to get started working with eAIRS-Web and building the war file.

Development Environment

The development environment will consist of Eclipse and a few plug-ins we will need to install using the Eclipse Update Site so we can access our subversion repositories and have all plug-ins build successfully. We have two team project sets that we will use to make obtaining the plug-ins for KNSG easier. The project sets are xml files that define what plug-ins to download to our workspace and from where.

Software

In this section, we will outline

  1. Installing Eclipse IDE for Java EE Developers
  2. Installing M2Eclipse - Maven Plugin
  3. Installing Google Plugin for Eclipse
  4. Installing Subversive Plug-in to Access Subversion
  5. Adding Subversion Repositories
  6. Downloading the Team Project Set for eAIRS-web
  7. Importing the Plug-ins Defined by the Team Project Set

Installing Eclipse IDE for Java EE Developers:

  1. First, download Eclipse Indigo (3.7.1) here. Download Eclipse IDE for Java EE Developers.
  2. Install Eclipse on your development machine.
  3. Launch Eclipse. When Eclipse first launches, it will ask you to specify a workspace (e.g. /home/cnavarro/workspaces/eairs-workspace). Optionally, after specifying a workspace, you can check the box "Use this as the default and do not ask again" box so that eclipse will not ask you to specify the workspace again.
  4. After Eclipse loads for the first time, you will need to select the "Go to the workbench" button located on the right right of your screen. The icon looks like an arrow.

Installing M2Eclipse - Maven Plugin

We need to install M2Eclipse, a Maven plug-in that is used by the eAIRS project for package management. To install it, do the following.

  1. While in Eclipse, go to Help-> Install New Software. Where it says "Work with:", select "Indigo - http://download.eclipse.org/releases/indigo" from the dropdown box.
  2. Find the Collaboration folder and expand it. Check the box next to "m2e - Maven Integration for Eclipse" and click Next.
  3. Click Next again. Accept the license terms and click Finish to install the new plugin.

After the plugin is finished installing, select "Restart Now" from the dialog box and continue to the next section.

Installing Google Plugin for Eclipse

Next, we need to install the google plugin for eclipse. You can find more detailed installation information about it here or just follow the steps below to install it. If you are having trouble installing the plugin, please see the previous website for more instructions.

  1. While in Eclipse, go to Help-> Install New Software. Click the "Add..." button. Where it says "Name" enter "Google Plugin" and where it says "Location": http://dl.google.com/eclipse/plugin/3.7 and click OK.
  2. Expand "Google Plugin for Eclipse (required)" and check the box "Google Plugin for Eclipse 3.7". Click Next.
  3. Click Next again. Accept the license terms and click Finish to install the new plugin.
  4. If you see a Security Warning dialog, click OK to continue.

After the plugin is finished installing, select "Restart Now" from the dialog box and continue to the next section.

Installing Subversive Plug-in to Access Subversion

Next, we need to install subversion, the source control plugin that we need to access the SVN repository where the source code is served.

  1. While in Eclipse, go to Help-> Install New Software. Where it says "Work with:", select "Indigo - http://download.eclipse.org/releases/indigo" from the dropdown box.
  2. Find the Collaboration folder and expand it. Check the box next to "Subversive SVN Team Provider (Incubation)" and click Next.
  3. Click Next again. Accept the license terms and click Finish to install the new plugin. You will need to restart eclipse once this is finished.
  4. Now, we need to establish connections to the subversion repositories used by eAIRS-web. Go to Window -> Show View -> Other. Under the category SVN, choose "SVN Repositories" and click OK. Eclipse will now recognize that you don't have any connectors installed and bring up a list of connectors to choose from. From the list, select the latest SVN Kit, which right now is SVN Kit 1.3.5. Select it and click the Finish button.
  5. This will bring up an install screen with the plug-ins that will be installed. Click Next. Click Next again. Accept the license terms and click Finish. When installing the connectors, you may see a dialog box pop up that says "Warning: You are installing software that contains unsigned content", go ahead and click OK and let the connectors install. You will need to restart Eclipse again once the installation finishes.

Adding Subversion Repositories

  1. Once Eclipse restarts, you should see a "SVN Repositories" view in your workbench. Click on the "New Repository Location" button and enter the following information.
    1. For URL: https://svn.ncsa.illinois.edu/svn/knsg
    2. For anonymous, read only access, leave the User and Password fields blank and click Finish; however, if you have read/write access, specify your username and password and then Click Finish. After clicking Finish, Eclipse may ask you to enter a secure storage password, go ahead and create one. This password is for securing passwords that are saved on your computer (e.g. if you enter a password and select to save the password). You may be presented with a Certificate dialog, click Trust or Trust Always (preferred).

Now that we have the repository setup, go to the next section to download the team project sets that will populate your workspace with the required plug-ins.

Downloading the Team Project Set for eAIRS-web

To download the team project set from the repository, do the following:

  1. Under the SVN Repositories view, expand the KNSG repository and then expand trunk. Checkout eairs-web.team. This plugin will contain a project set that will make it easier to get your workspace setup by downloading all the required plug-ins. The project set is called eairs-web-readonly.psf.

In the next section we will discuss how to import this project set.

Importing the Plug-ins Defined by the Team Project Set

Importing the project set files will populate your workspace with the plug-ins for eairs-web. To import the project set, do the following:

  1. To import the project sets, go to File -> Import. Expand "Team" and select "Team Project Set". Click Next. Click the "Browse" button, go into "eairs-web.team" and select "eairs-web-readonly.psf" and click Open. Click Finish. This operation may take some time since it will check out all plugins to your workspace, including the dependencies defined in Maven, which will contact the appropriate maven repository. You will see "Updating indexes", an operation that is building the maven repository on your machine. This operation can take some time the first time.

Building eAIRS-Web

If you are building eAIRS-Web on a Windows 7 machine, make sure Eclipse has the JDK defined for execution and not the JRE. Otherwise you might run into the error that Javac cannot be found when compiling the projects. You can check by locating the Eclipse Windows menu and doing the following: Windows > Preferences > Java > Installed JREs

Alternatively, you can define a JAVA_HOME environment variable specifying the Java home directory.

To build the eAIRS-Web War file, we need to build the following projects:

  • paw-persistance
  • paw-core
  • paw-authentication
  • paw-widgets
  • paw-execute
  • paw-search
  • paw-publish
  • edu.uiuc.ncsa.cet.bean
  • edu.uiuc.ncsa.cet.bean.tupelo

To build each project, right click on the project in Eclipse and go to Run As > "Maven Install". This will download any required jar's and build the jar file. The jar may take some time to build depending on the speed/memory of your machine. When it is finished, you should see: [INFO] BUILD SUCCESS and a few build statistics. Once you see that, build the next project until you have completed building all of the above jar's. If any of the projects do not have a "Maven Install" option, you might need to configure the project as a Maven project. To do so, right click on the project and go to Configure > Convert to Maven Project

After building the jars (in the order listed), the last step is to build to war file. The project that will build the war file is:

  • eairs-web

Right click on the project "eairs-web" and go to Run As > "Maven Install". This should build the war file. You might see an error similar to "java.lang.NoSuchMethodError: org.apache.maven.surefire.report.XMLReporter". This error can be ignored. Once this project builds, you can find the war file inside the eairs-web folder in your workspace. For example, if your workspace is at: /home/cnavarro/workspaces/eairs-workspace, then the war file can be found in: /home/cnavarro/workspaces/eairs-workspace/eairs-web/target and should be called "eairs-web-1.0-SNAPSHOT.war".

  • No labels