Project Tool Setup Instructions

This page generic instructions for setting up the development tools used in the Danno, Emmet and Chico projects.

Before you can build these projects, you will need to install a suitable Java SDK, and install / set up the Apache Maven build system on your machine. You may also need to preload your local repository; i.e. the one in "~/.m2/repository" with the "jsp-api" JAR file.


Java installation and setup

To build the Danno / Dannotate project, you need a copy of Sun's Java 6.0 SDK installed and configured. To check whether this has been done already, open a command shell window and run the following:

    javac -version

If a Java 6.0 SDK has been installed, and your shell environment is configured, it should output something like this:

    javac 1.6.0_14

If this doesn't work, or if it reports an older version of Java (e.g. "1.4.x" or "1.5"), figure out if this is just an issue with your $PATH (or %PATH% on Windows). If not, you will need to download and install an appropriate Java 6.0 distribution.

  • One alternative is to download and install Java from the Sun Java website. Make sure that you pick a SDK distribution (not a JRE distribution) for Java Standard Edition.
  • If you are using Linux, another alternative may be to install the OpenJDK 6.0 package(s) using the relevant package manager.

Once you have established that a Java 6.0 JDK is installed, check that your $PATH (%PATH%) variable includes the JDK installation's "bin" subdirectory, and that your $JAVA_HOME (%JAVA_HOME%) variable points to the installation directory.

Maven installation and setup

To build the Danno / Dannotate project, you need a copy of Apache Maven 2.2.x or later installed and configured. To check whether this has been done already, open a command shell window and run the following:

    mvn -v

If Maven 2.2 has been installed, you should see output that looks something like this:

    Maven version: 2.2.1
    Java version: 1.6.0_14
    OS name: "linux" version: "2.6.9-89.0.9.el" arch: "i386" Family: "unix"

If this doesn't work, or if it reports an older version of Maven, you will need to install Maven 2.2.

  • One alternative is to go to the Apache Maven website and download a suitable tarball or zip file. Then, simply untar or unzip in the location you install third-party software and add the "bin" subdirectory to your command search path.
  • If you are using Linux, another alternative may be to install the Maven 2.2 package(s) using the relevant package manager.

Notes:

  1. When you run Maven, it will download copies of external libraries used by the software being built, and copies of the Maven plugins used to do the building. This takes some time, especially when you are building for the first time on a new machine.
  2. If you are on a network that requires you to use a proxy server for external web access, you may need configure your Maven settings to use the proxy to access external repositories.
  3. To reduce download times (and network charges), you can use a repository mirror. Check with local folks to see if someone has already set up a local repository / mirror, and find out how to use it. Otherwise, you could even consider setting one up yourself.
  4. We have been using Maven 2.0 for development, but we've recently discovered that there is a bug in the Maven 2.0 'site' plugin that results in formatting errors in the generated site.

Preloading the Maven local repository

Like most J2EE applications, the Danno and Dannotate server side components depend on Sun's J2EE servlet APIs. Unfortunately the Maven Central repository does not contain a copy of the relevant JAR file for licensing reasons. The simple solution is to take the JAR file from your Tomcat 5.5 installation and install it in your local repository as follows:

    mvn install:install-file -Dfile=$CATALINA_HOME/common/lib/jsp-api.jar \
      -DgroupId=javax.servlet -DartifactId=jsp-api -Dversion=1.2 -Dpackaging=jar

(If you have a site repository, it would be worth installing the the "jsp-api" JAR file there.)

Eclipse IDE

We develop Danno and Dannotate using Eclipse, and a Subversion checkout of the project will include the ".project" and ".classpath" files used by Eclipse. We recommend using a recent "Eclipse for JEE" distribution, and adding a Subversion plugin (e.g. Subversive) and M2Eclipse.

When Using M2Eclipse, it is important to enable "Maven>Nested Modules" for the project to allow Eclipse to build the project. Also, beware that an Eclipse build of a Maven project allows a Java source level dependencies that a command-line Maven build flags as errors. It is therefore a good idea to build from the command-line when creating WAR files for deployment.