Chapter 2. Download and Build from Source

Table of Contents

2.1. Preliminaries
2.1.1. Tools required to build Simple Cart
2.1.2. Tools included in Simple Cart repository
2.1.3. Which libraries are required and used by Simple Cart
2.2. Checkout Sources from Subversion
2.3. Build Process
2.3.1. How ANT is integrated with Simple Cart
2.3.2. How to generate Simple Cart documentation
2.3.3. What if something goes wrong?
2.4. JUnit Test Cases
2.4.1. Business Logic (Domain Model) Testing
2.4.2. Hibernate Testing Considerations
2.4.3. Struts Testing Considerations
2.5. Testing within a Servlet Container
2.5.1. Testing inside Apache Tomcat
2.6. Making a Release
2.6.1. Repository Structure
2.6.2. Version Numbers
2.6.3. Goals of the Release
2.6.4. Testing Prior to a Release
2.6.5. Create a Tag and Branch

2.1. Preliminaries

For the impatient:

$ svn co https://svn.sourceforge.net/svnroot/simplecart/trunk .
$ ant
			

That should get the source, compile it and package it into a WAR distribution file for deployment inside a servlet container. If that didn't work, or you're not sure what you just did then read on through the rest of this chapter.

2.1.1. Tools required to build Simple Cart

Simple Cart is written in Java and so can compile with a standard JDK on any platform computer. The download will require around 30 Mb and another 30 Mb or so to compile. A standard computer (e.g. a Pentium III at 500Mhz or more) should be enough to do the job

Other tools required include the following:

  • Java Development Kit (JDK), 1.4 or later.
  • Apache Ant to run the automated build script which includes targets (or build files) for the main source tree, tests and documentation.
  • A Subversion client. Subversion is a revision control system and is the tool used to maintain the source code for the Simple Cart project.

For additional information about the tools required and where to download them please see Appendix A, Tools needed to develop with Simple Cart

2.1.2. Tools included in Simple Cart repository

  • JUnit, for running the JUnit test cases.

  • Saxon for building documentation from docbook format.

  • Docbook XSL style sheets.

  • fop for generating PDF versions of the docbook format.

    To build a PDF file with the pictures included you need Jimi.

2.1.3. Which libraries are required and used by Simple Cart

The libraries listed below are included in with the source code and must be available when deploying the software.

  • Hibernate is used for all database persistence within the Simple Cart application. Hibernate permits the use of Plain Old Java Objects in code without hard coding the details of database access and JDBC. Visit the Hibernate web site to learn more about this great technology!

  • Struts is a widely used Model View Controller (MVC) framework. This framework enables a clean separation between business functions and presentation which makes it straight forward to adapt Simple Cart to your company's particular style. More information about Struts can be found at their web site.

  • log4j is used for logging.