For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Administering MobileFirst applications through Ant
We can administer MobileFirst applications through the mfpadm Ant task.
Comparison with other facilities
We can execute administration operations with IBM MobileFirst™ Platform Foundation in the following ways:
- The MobileFirst Operations Console, which is interactive.
- The mfpadm Ant task.
- The mfpadm program.
- The MobileFirst administration REST services.
The mfpadm Ant task, mfpadm program, and REST services are useful for automated or unattended execution of operations, such as:
- Eliminating operator errors in repetitive operations, or
- Operating outside the operator's normal working hours, or
- Configure a production server with the same settings as a test or preproduction server.
The mfpadm Ant task and the mfpadm program are simpler to use and have better error reporting than the REST services. The advantage of the mfpadm Ant task over the mfpadm program is that it is platform independent and easier to integrate when integration with Ant is already available.
Prerequisites
The mfpadm tool is installed with the MobileFirst Server installer. In the rest of this page, product_install_dir indicates the installation directory of the MobileFirst Server installer. Apache Ant is required to run the mfpadm task. For information about the minimum supported version of Ant, see System requirements.
For convenience, Apache Ant 1.9.4 is included in MobileFirst Server. In the product_install_dir/shortcuts/ directory, the following scripts are provided.
- ant for UNIX / Linux
- ant.bat for Windows
These scripts are ready to run, which means that they do not require specific environment variables. If the environment variable JAVA_HOME is set, the scripts accept it.
We can use the mfpadm Ant task on a different computer than the one on which you installed MobileFirst Server.
- Copy the file product_install_dir/MobileFirstServer/mfp-ant-deployer.jar to the computer.
- Make sure that a supported version of Apache Ant and a Java™ runtime environment are installed on the computer.
To use the mfpadm Ant task, add this initialization command to the Ant script:
<taskdef resource="com/ibm/mfp/ant/deployers/antlib.xml"> <classpath> <pathelement location="product_install_dir/MobileFirstServer/mfp-ant-deployer.jar"/> </classpath> </taskdef>
Other initialization commands that refer to the same mfp-ant-deployer.jar file are redundant because the initialization by defaults.properties is also implicitly done by antlib.xml. Here is one example of a redundant initialization command:
<taskdef resource="com/ibm/mfp/ant/defaults.properties"> <classpath> <pathelement location="product_install_dir/MobileFirstServer/mfp-ant-deployer.jar"/> </classpath> </taskdef>
For more information about running the MobileFirst Server installer, see Run IBM® Installation Manager.
- Calling the mfpadm Ant task
We can use the mfpadm Ant task and its associated commands to administer MobileFirst applications.- Commands for general configuration
When we call the mfpadm Ant task, we can include various commands that access the global configuration of the IBM MobileFirst Platform Server or of a runtime.- Commands for adapters
When we call the mfpadm Ant task, we can include various commands for adapters.- Commands for apps
When we call the mfpadm Ant task, you can include various commands for apps.- Commands for devices
When we call the mfpadm Ant task, we can include various commands for devices.- Commands for troubleshooting
We can use Ant task commands to investigate problems with MobileFirst Server web applications.
Parent topic: Administering MobileFirst applications