For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Sample Ant files modifications

We can modify the sample Ant files that are provided in the mfp_install_dir/MobileFirstServer/configuration-samples directory to adapt to our installation requirements.

The following sections provide the details on how we can modify the sample Ant files to adapt the installation to our needs:

  1. Specify extra JNDI properties
  2. Specify existing users
  3. Specify Liberty Java EE level
  4. Specify data source JDBC properties
  5. Run the Ant files on a computer where MobileFirst Server is not installed
  6. Specify WebSphere Application Server Network Deployment targets
  7. Manual configuration of the RMI port on Apache Tomcat


Specify extra JNDI properties

The installmobilefirstadmin, installmobilefirstruntime, and installmobilefirstpush Ant tasks declare the values for the JNDI properties required for the components to function. These JNDI properties are used to define the JMX communication, and also the links to other components (such the live update service, the push service, the analytics service, or the authorization server). However, we can also define values for other JNDI properties. Use the <property> element that exists for these three tasks. For a list of JNDI properties, see:

For example:

<installmobilefirstadmin ..> <property name="mfp.admin.actions.prepareTimeout" value="3000000"/> </installmobilefirstadmin>


Specify existing users

By default, the installmobilefirstadmin Ant task creates users:

To use an existing user instead of creating new user, we can do the following operations:

  1. In the <jmx> element, specify a user and password, and set the value of the createLibertyAdmin attribute to false. For example:

    <installmobilefirstadmin ...> <jmx libertyAdminUser="myUser" libertyAdminPassword="password" createLibertyAdmin="false" /> ...

  2. In the <configuration> element, specify a user and password and set the value of the createConfigAdminUser attribute to false. For example:

    <installmobilefirstadmin ...> <configuration configAdminUser="myUser" configAdminPassword="password" createConfigAdminUser="false" /> ...

Also, the user that is created by the sample Ant files is mapped to the security roles of the administration service and the console. With this setting, we can use this user to log on to MobileFirst Server after the installation. To change that behavior, remove the <user> element from the sample Ant files. Alternatively, we can remove the password attribute from the <user> element, and the user is not created in the local registry of the application server.


Specify Liberty Java EE level

Some distributions of WebSphere Application Server Liberty support features from Java EE 6 or from Java EE 7. By default, the Ant tasks automatically detect the features to install. For example, jdbc-4.0 Liberty feature is installed for Java EE 6 and jdbc-4.1 feature is installed in case of Java EE 7. If the Liberty installation supports both features from Java EE 6 and Java EE 7, you might want to force a certain level of features. An example might be that you plan to run both MobileFirst Server V8.0.0 and V7.1.0 on the same Liberty server. MobileFirst ServerV7.1.0 or earlier supports only Java EE 6 features.

To force a certain level of Java EE 6 features, use the jeeversion attribute of the <websphereapplicationserver> element. For example:

<installmobilefirstadmin execute="${mfp.process.admin}" contextroot="${mfp.admin.contextroot}"> [...] <applicationserver> <websphereapplicationserver installdir="${appserver.was.installdir}" profile="Liberty" jeeversion="6">


Specify data source JDBC properties

We can specify the properties for the JDBC connection. Use the <property> element of a <database> element. The element is available in configureDatabase, installmobilefirstadmin, installmobilefirstruntime, and installmobilefirstpush Ant tasks. For example:

<configuredatabase kind="MobileFirstAdmin"> <db2 database="${database.db2.mfpadmin.dbname}" server="${database.db2.host}" instance="${database.db2.instance}" user="${database.db2.mfpadmin.username}" port= "${database.db2.port}" schema = "${database.db2.mfpadmin.schema}" password="${database.db2.mfpadmin.password}"> <property name="commandTimeout" value="10"/> </db2>


Run the Ant files on a computer where MobileFirst Server is not installed

To run the Ant tasks on a computer where MobileFirst Server is not installed, you need the following items:


Specify WebSphere Application Server Network Deployment targets

To install on WebSphere Application Server Network Deployment, the specified WebSphere Application Server profile must be the deployment manager. We can deploy on the following configurations:

The sample files such as configure-wasnd-cluster-<dbms>.xml, configure-wasnd-server-<dbms>.xml, and configure-wasnd-node-<dbms>.xml contain the declaration to deploy on each type of target. For more information, see the Ant tasks to install each MobileFirst Server component at Installation reference.

Note: As of V8.0.0, the sample configuration file for the WebSphere Application Server Network Deployment cell is not provided.


Manual configuration of the RMI port on Apache Tomcat

By default, the Ant tasks modify the setenv.bat file or the setenv.sh file to open the RMI port. If you prefer to open the RMI port manually, add the tomcatSetEnvConfig attribute with the value as false to the <jmx> element of the installmobilefirstadmin, updatemobilefirstadmin, and uninstallmobilefirstadmin tasks.

Parent topic: Installing with Ant Tasks