Wednesday, August 09, 2006

Quick start using Maven 2 with Spring Rich Client Project


A previous blog detailed how to get a local copy of the project source. Spring Rich Client has been refactored as of the 0.1 release to use Maven 2.0 as the Build Manager. This blog will walk though the steps involved in working with Maven to fetch the project dependencies, do a build and run the tests from scratch. The blog is pitched at an audience new to the Maven experience.


1. Download Maven 2 and follow the installation instructions. Make sure you verify the installation as suggested in the last step of the installation procedure before moving on.

2. The previous blog fetched the project source in to the local directory:

C:\spring_richclient

In here, the maven POM.XML file exists that defines, amongst other things, all the dependencies for the project. Open up a command window in this project root directory, and then execute the Maven install command as follows:

C:\spring_richclient\mvn install

Maven takes over and will start to create a local repository of the Spring Rich Client dependencies (eg third party libraries as JAR files etc). If you want to have a look, the maven repository is usually created in your working directory, under the directory “.m2”. For example, on Windows, this would typically be:

C:\Documents and Settings\\.m2

NOTE: As mentioned in the main project website, the install may not succeed first time and you could end up with command screen contents similar to the following:
The solution to this issue is to run the mvn install command again, and as many times as necessary for all the dependencies to be correctly downloaded and the build and tests to succeed. The initial installation can fail several times due to bad connections to the online repository etc. You will know when Maven has succeeded when you are presented with a screen similar to the following:
Note that this whole procedure can take quite a significant amount of time the first time it is done. You can see that in the command window above where it has taken 51 minutes to complete. Your mileage may vary on that time. From then on, however, the command works much faster as everything is stored locally. On successful completion, we will have all the project dependencies managed locally, a clean build of the project and (hopefully) a successful pass of all unit tests.

Tuesday, August 08, 2006

Using Tortoise Subversion Client for Windows to fetch the
Spring Rich Client Project

1. Download and Install Tortoise SVN Client For Windows from:

http://www.tortoisesvn.net/downloads

Note: For this guide, we are using Tortoise SVN version 1.3.5

With the Tortoise SVN client properly installed, we are going to checkout the latest project source for Spring Rich Client from the sourceforge Subversion repository to the local directory:

C:\spring-richclient

(You can set this location to be whatever suits your needs best)

The Subversion repository URL for the project is:

https://svn.sourceforge.net/svnroot/spring-rich-c/trunk/spring-richclient/

2. Right click on a windows Explorer pane and select the SVN Checkout option as shown the following figure:

3. You are presented with a dialog in which you need to set the Repository URL for the source to be:

https://svn.sourceforge.net/svnroot/spring-rich-c/trunk/spring-richclient/

Set the checkout directory to be:

C:\spring-richclient

(…or wherever you wish to locate the source). The following figure shows these settings as you should expect to see them:


3. Proceed to checkout the project by clicking OK. If it doesn’t already exist, the Tortoise client will prompt you to create the local source directory. When complete you should see a dialog similar to the following:


The project source should now be successfully installed on your local machine.

NOTE: The project source structure is set up in a modular fashion. Currently, however, the majority of the module subdirectory projects do not contain actual java code. The structure is a template for future refactorings when the main source is indeed split in to modules. You can find the majority of thye current source code under the project module named "support".