![]() | ![]() |
Apache > Jakarta > Cactus > Participating | Docs for: v1.6.1 | v1.7dev Last update: May 14 2004 |
IntroductionThis tutorial explains how to build Cactus from CVS or from a source download.
If you just want to use Cactus, it will be easier to simply download
a nightly build (if you need the
latest and greatest), or the latest
stable release otherwise.
Getting the SourceThere are two ways to obtain the source code for Cactus: either directly from CVS, or by downloading a prepackaged source archive. CVSTo get the current development version of the Cactus source code, you'll need to download the source from CVS. To do this, you'll need to have a CVS client installed.
Detailled instructions about accessing the Apache CVS repository can
be found
here. The module name for Cactus is
Prepackaged Source ArchivesIf you don't have access to the Apache CVS repository (because you're behind a firewall, for example), or you don't need to be absolutely up to date, you can download an archive containing a snapshot of the Cactus code base. Such archives are made available for each release as well as for the nightly builds. Go here to find out about the download locations. Prerequisites
To build Cactus from source, you'll need to have
Ant 1.5.3 (or later)
installed. Please make sure that the distribution also includes the JAR
containing the optional tasks (
In addition, Cactus depends on a number of additional external
libraries at build time. When not otherwise mentioned, these libraries
can be used by either placing them in the Required LibrariesThe following libraries are required to compile the Cactus framework. The integration modules and samples have additional dependancies that are listed as optional libraries below.
Optional Libraries
If you don't want to experience version conflicts, you need
to get the versions corresponding to Cactus releases. For example,
If you're building Cactus 1.4.1 from its sources, you'll need to get
the jars found in the corresponding Cactus distribution. If you are
building from CVS, you can get the latest jars from the
Gump nightly builds.
In the future we might make this process easier by moving our build
system to Maven.
Make sure you have only one XML parser. If you had the Crimson jar
you will need to remove it.
Understanding the Directory StructureThe Cactus project is divided into several modules, each having its own build:
All modules follow a similar directory structure and they all use Ant as the build tool. Performing Builds
First, you need to create a
Alternatively you can provide a
build.properties file
in the top-level directory. This file will be used by all modules.
Then, open a shell, change into the module directory and execute
$ cd framework $ ant -projecthelp Buildfile: build.xml Cactus Framework --------------------------------------------------------- Contains the core classes of the Cactus in-container testing framework. Main targets: checkstyle Perform a code audit using Checkstyle clean Clean all generated files compile Compile the sources dist Generate the distributable files doc Generates the API documentation jar Generate the library jar test Run the unit tests Default target: dist
Simply execute the target you need. To build the framework, you
can invoke $ cd framework $ ant dist
Some projects depend on others and thus you may need to run the build
for those projects first. For example, the servlet sample depends on
the framework and the Ant integration, so these will need to be built
before the servlet sample is built.
The top-level directory contains a master build file that can be used
to build all modules in the correct order ( Before creating a patch, and especially before committing changes, be sure to run both the checkstyle and test targets of the corresponding module. Often we will also need to run the servlet sample tests, because they effectively represent the regression test suite for Cactus. You might want to simply perform a full rebuild to be sure that nothing has been negatively affected by your changes. |