Database Reference
In-Depth Information
1. Make sure you have Ant installed and that the ant command is in your path
(type ant -version to check).
2. Open the build.xml file and check if the properties listed under the heading BASE
INFORMATION apply to your situation. You will have to change at least the admin
password property for the examples to work.
3. Open a command window and navigate to the directory where you stored the
build.xml file.
4. The command ant -p will give you an overview of the targets defined.
5. ant targetname will execute a target (e.g., ant ListMainCollections ).
Preparing an eXist Ant Build Script
If you would like to use the eXist Ant extensions inside your Ant build script, follow
these steps:
1. Define the http://exist-db.org/ant namespace. The recommended name‐
space prefix is xdb . The easiest way to do this is to add the namespace definition
to the root project element of your Ant build file (usually called build.xml ):
<project xmlns:xdb= "http://exist-db.org/ant" >
2. Before you use the extension in your build script, you must tell Ant where it can
find the eXist extension libraries. The following code example assumes that on
the operating system level the EXIST_HOME environment variable is set and points
to the directory where you have installed eXist:
<property environment= "Env" />
<fail unless= "Env.EXIST_HOME" > Environment variable EXIST_HOME not set
</fail>
<path id= "classpath.core" >
<fileset dir= "${Env.EXIST_HOME}/lib/core" >
<include name= "*.jar" />
</fileset>
<pathelement path= "${Env.EXIST_HOME}/exist.jar" />
<pathelement path= "${Env.EXIST_HOME}/exist-optional.jar" />
<pathelement path= "${Env.EXIST_HOME}" />
</path>
3. If you want to use Ant-Contrib as well, add the following code:
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement
location=" $EXIST_HOME /tools/ant/lib/ant-contrib-1.0b3.jar"/>
Search WWH ::




Custom Search