# How To Build POI

# Installing Ant

The POI build system requires two components to perform a build. Ant and forrest.

Specifically the build has been tested to work with Ant version 1.5.3 and Forrest 0.4. To install these products download the distributions and follow the instructions in their documentation. Make sure you don't forget to set the environment variables FORREST_HOME and ANT_HOME. The ANT_HOME/bin directory should be in the path.

One these products are installed you will also need to download some extra jar files required by the build.

Library | Location
--- | ---
junit | http://www.ibiblio.org/maven/junit/jars/
xerces | http://www.ibiblio.org/maven/xerces/jars/
jdepend | http://www.ibiblio.org/maven/jdepend/jars/
xalan | http://www.ibiblio.org/maven/xalan/jars/

Just pick the latest versions of these jars and place them in ANT_HOME/lib

# Running the Build

On the first run the ant build system will download all the jars required by the project to build ant. If you're behind a firewall this may cause some problems. Should you need to it's possible to manually put the jars in the correct directories. These can be obtained from here:

JAR | Location
--- | ---
/commons-logging/jars/commons-logging-1.0.1.jar | lib
/log4j/jars/log4j-1.2.8.jar | lib
/commons-beanutils/jars/commons-beanutils-1.6.jar | src/contrib/lib
/commons-collections/jars/commons-collections-2.1.jar | src/contrib/lib
/commons-lang/jars/commons-lang-1.0-b1.jar | src/contrib/lib
/junit/jars/junit-3.8.1.jar | lib

The main targets of interest to our users are:

Target | Description
--- | ---
clean | Erase all build work products (ie, everything in the build directory
compile | Compiles all files from main, contrib and scratchpad
test | Run all unit tests from main, contrib and scratchpad
docs | Generate all documentation for the system
generate-records | Generate records from the XML record defintitions
generate-types | Generate types from the XML type definitions (this is for HDF).
jar | Produce jar files
dist | Create a distribution.
clean-dist | Runs clean before creating the distribution.