Deploy a project WAR file and configure the application server with Ant tasks
Use Ant tasks to...
- Deploy the project WAR file to an application server
- Configure data sources, properties, and database drivers
Before deploying...
Each WAR file must have its own set of tables. Either the database, or the schema where the tables are stored, must be different. For Oracle, the database user must be different.
Run the Ant task on the computer where the application server is installed, or the dmgr for WAS ND. To start the Ant task from a computer on which Worklight Server is not installed, copy the following file to that computer...
MF_SERVER/WorklightServer/worklight-ant-deployer.jar
- Review the environment ID used to install the MobileFirst Server administration.
This environment ID is installed as a JNDI property.
If the MobileFirst Server administration used an environment ID, install the project WAR file with the same environment ID. Otherwise, that project WAR file cannot be managed by the MobileFirst Server administration.
- Edit the Ant script we will use later to deploy the Project WAR File.
- Review the sample configuration files and copy the Ant file corresponding to the database. The files for deploying a project WAR file are named after the following pattern:
If the file name follows the pattern configure-appServer-database.xml, we can reuse it for Create databases with Ant tasks,
- Edit the sample Ant file and replace the placeholder values for the properties at the top of the file.
- If the MobileFirst Server administration uses an environment ID, and you run an Ant task for the installation, add an environmentID attribute to the following Ant tasks, used for the administration installation:
- installworklightadmin
- updateworklightadmin
- uninstallworklightadmin
- configureapplicationserver
- updateapplicationserver
- unconfigureapplicationserver
See: Ant tasks for installation of operations console and administration services.
Important: The value of the attribute must be the same as the one used for the MobileFirst Server administration.
- To deploy the project WAR file...
ant -f configure-appServer-database.xml install
We can find the Ant command in MF_INSTALL/shortcuts
What to do next
See also:
- Ant tasks for installation of MobileFirst runtime environments
- Sample configuration files
- Use Ant tasks to install MobileFirst Server administration
- Configure WAS ND servers
Parent topic: Use Ant tasks to deploy the project WAR file