My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
DevelopmentEnvironmentSetup  

Resource, Developer
Updated Feb 4, 2010 by mattijsh...@gmail.com

# How to set up your development environment

Introduction

To start developing webical there are a few steps you need to take. This page lists the requirements and necessary steps to set up the development environment that is need to develop webical. This environment is based on open source software.

This guide assumes you use the default setup. Derivations are possible, but you should have some more understanding of development environments and the components used in Webical.

Requirements

Install the above software in places you find suitable.

Setting up Maven

The maven website states the following:

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

We use maven to compile and package Webical and manage all the dependencies in a clear way. Maven works with pom (Project Object Model) files. These xml files are used to configure the project.

To set up Maven2, download it and add it to your system path. Guides on Linux, Windows and Mac OSX are available.

Because of license issues Maven doesn't have the JTA classes in its repository. You have to download them yourself and install them manually for Maven. The JTA classes can be downloaded from the sun website.

Once downloaded install the JTA classes with the following command:

mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=jta-1.0.1B-classes.zip -DgeneratePom=true

Setting up Eclipse

Download eclipse from the above location and extract it in a suitable directory. Make sure you have java 5 installed.

In order to use Eclipse for Webical development you need to install the Aspect for J plugin. This plugin can be downloaded from within Eclispe using the Find and install software option from: Help > Software updates > Find and install ...

The plugin is available from the Eclipse Europe Discovery Site. For more information see the AJDT homepage.

For more Eclipse settings see the Eclipse shortcuts page.

The next step is to add the Maven2 repository to your Eclipse variables so Eclipse can find the dependencies downloaded by Maven2. To do this open Window > Preferences > Java > Build Path > Classpath Variables. Add a variable named M2_REPO that points to /home/YOUR_NAME/.m2/repository.

Setting up the Database

For Webical development we use a MySQL database. When running the development version of Webical it will automatically create the database tables. You only need to provide a database named webical and a user named webical with password webical that has all rights to that database. The default settings assume your database is running at localhost:3306. Databases with alternative locations will be handled later in this guide.

Getting the source

To start development on Webical, you need its source. We use Subversion as our source control software. You can check out the source, using subversion from http://webical.googlecode.com/svn/trunk/.

You can do this by using the svn command line tool, or a graphical interface. The following line of code will download the webical project to a new directory inside the current directory named webical:

 svn checkout http://webical.googlecode.com/svn/trunk/ webical

Setting up the project for Eclipse

To open the project in Eclipse, we are going to let Maven build the Eclipse project files. Enter the directory you checked out the Webical source to. Inside the directory execute the following command:

 mvn -Dwtpversion=1.5 -DdownloadSource=true eclipse:eclipse

This command will create an Eclipse project for us which we can import into Eclipse. The parameter -DdownloadSources=true is optional and is only needed the first time. This parameter makes sure Maven downloads all the project dependencies for us.

After Maven has created the Eclipse project for us, we can import it into Eclipse. Start Eclipse and select your workspace. Import the Webical project via File > Import.

Select the folder you downloaded the source into and Eclipse will show you the Eclipse projects you can import. Webical consists of two Eclipse projects: webical-core and webical-war. Both of them need to be imported.

Starting Webical in development mode

Starting Webical for development is easy. Webical-war comes with an integrated Java server called Jetty. To start Webical in development mode, select the webical-war project from the project explorer en choose Run > Run As > Java Application. From the list, search and choose StartWebApplication from the package org.webical.web. The output should appear in the console and once the application is loaded you can visit it at http://localhost:8888/webical/.

POM Changes

Every time changes are made in the pom.xml file of one of the Webical projects, Maven needs to recompile the projects. So every time you change a POM file you have to execute the following line of code from the Webical source directory:

 mvn -Dwtpversion=1.5 eclipse:clean eclipse:eclipse

This will clean the eclipse project and lets Maven create a new one. the option -DdownloadSource=true is optional again. After this is done, preferably with Eclipse closed, make sure you reload the projects in Eclipse to reflect the latest changes.


Sign in to add a comment
Powered by Google Project Hosting