![]() | ![]() |
Apache > Jakarta > Cactus > Participating | Docs for: v1.7.2 | v1.7 Last update: August 30 2007 |
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.
Detailed 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. PrerequisitesThe following sections list java libraries that you need to have present in your local filesystem for the build. Do not worry! We won't ask you to fish around to get these libraries :-) We have created an Ant script that does this automatically. The next section on Performing Builds explains how to use it. AntTo build Cactus from source, you'll need to have Ant 1.6.1 (or later) installed. For building the Maven plugin you'll need to have Maven 1.0 (or later) installed.
You'll need to have the following libraries put in your
Required Libraries
In addition, Cactus depends on a number of additional external
libraries at build time. The locations of these libraries on
your file system should be specified in your
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 (except for the Performing Ant buildsGood news: it should be extremely easy to build Cactus from the sources! :-) After ensuring that you connected to internet, type the following 2 commands one after another:
The build result will be located in the Now, there are 2 files that you may wish to copy and edit if you wish to customize the Cactus build:
To get help about the Ant targets available to build a given subproject,
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
Then, 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. To avoid these problems you can
simply type
ant dist at the top level as it builds the
different projects 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. Generating the Maven plugin
To generate the maven plugin, you must first perform the Ant build (see above). Than you just need to go to the |