First Steps

From Intrument Element Wiki

Jump to: navigation, search

For a description about the Architecture please refer to the Architecture page.

Setting up the Eclipse environment

  1. Download and install a Tomcat Binary Distribution. Look for an article on how to setup Tomcat on your OS.
  2. Install the Sysdeo Tomcat plugin.
  3. You will also want the Maven 2 Eclipse plugin .
    • simply from inside eclipse go to help->install new software and add this link to install Maven:
    • Be careful. don't install unnecessary and optional plug-ins like "Maven Integration for AJDT" or "Maven Integration for WTP", otherwise it may show error regarding unsatisfying requirements.
  4. Check out the Tiny Instrument Element project from SVN (module: tips for subversion) . Control to make sure that Eclipse considers the project a Maven 2 Project.

The only way to make Eclipse work with Maven is to follow its default layout. This means that web.xml is in src/main/webapp/WEB-INF, all of the library dependencies are defined in pom.xml, and all of the libraries will download into the Maven 2 Dependencies collection the first time you run mvn on the project.

Edit pom.xml to make sure you have your dependencies defined as you want them and that your project name and version are what you'd like.

Now is a good time to run a build of the project just to set up all of the remaining directories (like the target directory). I did this by configuring an m2 build from the External Tools menu using my project's location as the Base directory with the goal "install."

Now set up the Tomcat plugin. From Window | Preferences | Tomcat, configure the appropriate Tomcat version and Tomcat home. From the context menu of your project, select Properties and then Tomcat. Check "is a Tomcat project." Set the context name to "/" and check "Can update context definition" and "Mark this context as reloadable." Set the subdirectory to "/target/your_project_name-your.project.version." The project name and version here must match what you've defined in pom.xml.

Now set up Eclipse to build directly to the Maven output directory. This allows you to avoid running an mvn build every time you make a change to a class or resource file. You will still need to run an mvn build if you add or change dependencies or if you change web.xml, however. From the project's properties context menu, choose Java Build Path and set the default output folder to target/your_project_name-your.project.version/WEB-INF/classes.

Lastly, from your project's context menu, choose Tomcat Project | Update Context Definition.

To recap, here are the steps:

  • 1. Download and install Maven 2, Eclipse, Tomcat, the Maven 2 plugin for Eclipse, and the Tomcat plugin for Eclipse.
  • 2. Check out the Tiny Instrument Element project.
  • 3. Edit pom.xml to define the version number and your dependencies.
  • 4. Edit/Put web.xml in src/main/webapp/WEB-INF.
  • 5. Create a m2 external build and run it to create your target directory structure.
  • 6. Configure the Tomcat plugin to look in Maven's target directory for your webapp's directory structure.
  • 7. Configure Eclipse to build directly to Maven's target directory structure.


Please refers to the following page: Installation_Guide

Personal tools