You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

GLAST Java Development Tutorial

This is the beginning of a tutorial on performing Java development for GLAST software. The idea of using confluence for this tutorial is to encourage others to comment on and extend the material here. The current content is certainly very incomplete so it should not be hard to improve on it.

Topics covered

Tools Overview

Tool

Used for...

CVS

Version control, a repository which keeps all of the source code, and tracks changes to source code over time

TortoiseCVS

A windows based version of CVS which integrates CVS functionality directly into windows explorer.

Maven

Build tool and project management. Almost all GLAST software projects use Maven. Maven can be used to compile code, deploy applications, build web sites. It is based on a project description which declares how the code is to be build, and what other projects (Glast and 3rd party) the code depends on. Maven takes care downloading the appropriate versions of all dependencies for you. Note we use maven 1.0.2 for our projects, newer versions are incompatible and will not work

Tomcat

Web/Application server. Tomcat is a Java based web server, commonly called an application server. Tomcat allows web applications to be dynamically (re)deployed. We run a number of different tomcat servers, some for production use, some for development/testing. Tomcat can also be started on your own machine for testing applications as you develop them.

Netbeans

An integrated development environment for developing Java applications. We primarily use netbeans for developing web applications, and use the tomcat server which is built-in to netbeans for testing these applications.

mevenide

mevenide is a plugin which can be installed into netbeans, which extends netbeans so that it understands how to open, build and deploy maven based applications

Installing the tools

Windows

Unix

Getting Started

Checking out a project

Opening a project with Netbeans

Anatomy of a web application

We will use the org-glast-groupmanager project as an example. Its contents can be viewed in CVS here.

All of our web applications consist of the following:

  • A top level directory which contains the maven files.
    • project.xml – The main description of the maven project, including the list of dependencies
    • project.properties – Additional information used by project.xml
    • maven.xml – Specifies additional "goals" which can be run on the project. We use this file to specify how the project should be deployed to central tomcat servers.
  • A src/webapp directory which contains the java server pages (JSP) for the application
  • A src/main/java directory which contains any Java source code, and related resource files.
  • No labels