This tutorial explains how to build Cactus from SVN or from a source download.
There are two ways to obtain the source code for Cactus: either directly from SVN, or by downloading a prepackaged source archive.
To get the current development version of the Cactus source code, you'll need to download the source from SVN. To do this, you'll need to have a SVN client installed.
Detailed instructions about accessing the Apache SVN repository can be found here.
If you don't have access to the Apache SVN 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.
The 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 :-) The Maven2 build system does this automatically. The next section on Performing Builds explains how to use it.
You'll need to have the following libraries put in your
|junit.jar||No||3.8.1 or later||The JUnit unit testing framework.|
|ivy-[version].jar||No||2.0.0-beta1||The Ivy dependency management library.|
|xalan.jar||Yes. Required only if you're building with a JDK version lower than 1.4. You should also be able to use a different XSLT processor.||(not sure - we need to find the version)||A XSLT processor.|
Yes. Required only to run the release build of Cactus or if you
have turned on "clovering" (
||1.2.3||Clover code coverage tool.|
In addition, Cactus depends on a number of additional external libraries at build time. The Maven2 build system will download automatically these dependencies in the local repository.
|aspectjrt.jar||1.1.1 +||The AspectJ runtime.|
|aspectjtools.jar||1.1.1 +||The AspectJ compiler and other tools.|
|commons-httpclient.jar||2.0 +||Jakarta Commons HttpClient.|
|commons-logging.jar||1.0.3 +||Jakarta Commons Logging.|
The JUnit framework.
This JAR file must be placed in the
|servlet.jar||2.2, 2.3 or 2.4||
The Servlet/JSP API.
This JAR file comes with your servlet container or application server. To perform a complete build of Cactus, you'll need to have JARs for versions 2.2, 2.3 and 2.4 of the servlet API.
|checkstyle.jar||3.4||The Checkstyle code auditing tool.|
|antlr.jar||2.7.2||The ANTLR translator generator (required by Checkstyle).|
|commons-beanutils.jar||1.6.1||Jakarta Commons BeanUtils (required by Checkstyle).|
|commons-collections.jar||2.1||Jakarta Commons Collections (required by Checkstyle).|
|regexp.jar||1.3||Jakarta RegExp (required by Checkstyle).|
|httpunit.jar||1.5.4 +||HttpUnit. Required for testing the HttpUnit integration.|
|nekohtml.jar||0.8.1||The Cyberneko HTML parser (required by HttpUnit).|
|log4j.jar||1.2.8||Jakarta Log4j. Required for packaging the Cactus distribution.|
|jstl.jar||1.0.2||JSP Standard Tag Library. Required for compiling and running the servlet sample test suite on J2EE 1.3.|
|standard.jar||1.0.2||Jakarta Standard Taglib. Required for compiling and running the servlet sample test suite on J2EE 1.3.|
|jetty.jar||4.2.17 +||Jetty Servlet container. Required to build and run the Jetty sample project.|
|jasper-compiler.jar||4.1.30 +||JSP engine required by Jetty to process JSPs. Required to build and run the Jetty sample project.|
|jasper-runtime.jar||4.1.30 +||JSP engine required by Jetty to process JSPs. Required to build and run the Jetty sample project.|
|jmock.jar||1.2.0||Mock object library used by several unit tests.|
|cargo-uberjar.jar||0.9||Cargo framework for manipulating the different containers.|
|cargo-ant.jar||0.9||Cargo-ant tasks for manipulating the different containers.|
The Cactus project is divided into several modules, each having its own build:
All modules follow a similar directory structure and they all use Maven as the build tool.
Good news: it should be extremely easy to build Cactus from the sources! :-) After ensuring that you connected to internet, type the following command one after another:
mvn clean install: This will automatically download all the required dependencies. It takes about 7 minutes on a 512 kbps internet connection the first time. If you're behind a firewall, you'll need to read this tutorial for specifying a proxy.
mvn installat 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 plugins 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.
So after you have checked out the source of Cactus there is one more step to make in order to get the assemblies. First, as usual, ensure that you are connected to the internet. After that go to the top-folder of the Cactus check-out and follow these steps.
mvn clean package: This will make all of the submodules to package their jars.
mvn assembly:assembly -N: This will automatically start making the assemblies, and once the download of all of the required dependencies is finished you will see a
target/folder in the top-level folder. This folder will contain the assemblies for the Cactus project.