Ant Tasks for Mule Applications
Ant is a tool for building Java applications, which can be extended by adding custom tasks. These tasks will let you build and deploy Mule applications.
To use these tasks:
Add
-lib mule-anttasks.jar
to your Ant command line, to put the classes that implement the tasks in Ant's classpath.
Add
<taskdef resource="org/mule/mulePackagingTasks.properties"></taskdef>
to your Ant build file, to import the task definitions.
mulePackage
Description
Create a Mule application archive.
Parameters
| Attribute | Description | Required |
| applicationFile | the application file to be created | Yes |
Parameters specified as nested elements
| Element | Description |
| config | A FileSet specifying configuration files to be placed at the top level of the application. |
| lib | A FileSet specifying jar files to be placed in the application's lib folder. |
| classes | A FileSet specifying class and resource files to be placed in the application's classes folder. |
Examples
<config dir="src/app"/>
<lib dir="target/lib"/>
</mulePackage>
packages the application ${app.file} using the configuration files in the config directory and the jars in the lib directory. In this example, there were no classes or resources outside the jars.
<config dir="src/app"/>
<classes dir="target/classes"/>
<lib dir="target/lib"/>
</mulePackage>
packages the application ${app.file} using the configuration files in the config directory, the classes and resources in the classes directory, and the jars in the lib directory.
muleDeploy
Description
Deploys a Mule application archive.
Parameters
| Attribute | Description | Required |
| applicationFile | the application file to deploy | Yes |
| muleHome | the base directory for the Mule installation | No |
If muleHome is not specified, the value of the property dir.mule.home is used.
Examples
deploys the application ${app.file} to the mule installation at ${dir.mule.home}, which can be set either in the Ant build file or on the Ant command line.
deploys the application ${app.file} to the mule installation at /usr/opt/mule.
With our library of Cloud Connectors and repeatable integration solutions, you can rapidly create connectivity either on premise or in the cloud.