To use ANT tasks for WSO2 SOA Enablement Server in your ANT build script, you must add the task classes into the ANT classpath. You then define a new ANT task using the Java task class from our library.
To add the task classes into the ANT classpath, edit the ANT launch script which you use. Add the WASP_HOME/lib/core-tools.jar file to the classpath of the java command which starts ANT. To deploy to/undeploy from a WSO2 SOA Enablement Server (DeployTask/UndeployTask) with security installed, also add WASP_HOME/lib/security-tools.jar to the classpath.
In the ANT build file, each task is defined within the <project> tags. The <taskdef> tag defines an ANT task, using this form:
<taskdef name="name_of_the_task" classname="java_task_class"/>
The name attribute value is the name of the element you will use in your build file to call the task. The classname attribute is the name of the Java task class that implements the task.
The predefined task and related classes are described in the following sections. Each section is devoted to an ANT task whose functionality is encapsulated in a specific WSO2 SOA Enablement Server tool. As in standard API document formats, the name and classname values for the task are indicated in an initial table. Secondary tables indicate the attributes that modify the functionality of the tool.
![]() | Note |
---|---|
The user can find examples of ANT tasks in use in WASP_HOME/src/example/tools/ant and the build.xml files in Demos. |
Any task may contain property sub-elements. These contain two compulsory attributes: key and value. They function in much the same way as an assignment statement, with the specified key set to the specified value. The key represents a pre-declared system property used by the Java task class and passed through the JVM. These properties can also be set as command line options.