+

Search Tips   |   Advanced Search

Ant tasks for building and deploying applications and adapters


Prerequisites

Ant tasks are supplied with MobileFirst Server and the MPF Command Line Interface. Use them to build and deploy the applications, adapters, and projects.

A typical use of these Ant tasks is to integrate them with a central build service called manually or periodically on a central build server.

Make sure Apache Ant is installed. The minimum supported version of Ant is listed in System requirements for using MPF.

Apache Ant 1.8.4 is included in MobileFirst Server.

These scripts do not require specific environment variables. If the JAVA_HOME environment variable is set, the scripts accept it.


See


Build from a IBM Worklight v6.0.0 project and deploying to a v6.3.0 MobileFirst Server

If we want to build apps and adapters from a IBM Worklight v6.0.0 project and deploy them to a v6.3.0 MobileFirst Server, you might think that all we need to do is add a <taskdef> definition as shown in the following Ant task.

<taskdef resource="com/worklight/ant/defaults.properties">
    <classpath>
       <pathelement location="WL600_DIR/WorklightServer/worklight-ant.jar" />
    </classpath>
</taskdef>

<taskdef resource="com/worklight/ant/deployers/antlib.xml">
   <classpath>
   <pathelement location="MF_HOME/WorklightServer/worklight-ant-deployer.jar" />
 </classpath>
</taskdef>

However, the JAR files worklight-ant.jar and worklight-ant-deployer.jar conflict, because they contain classes with the same name in different versions.

To solve this conflict, we must split the script into two different Ant files: one to build v6.0.0 artifacts and the other to deploy them to the v6.3.0 server, as shown in the following examples.


Parent topic: Deploy MobileFirst applications to test and production environments