.. module:: mapstore.buildfile
:synopsis: MapStore build file.
.. _mapstore.buildfile:
MapStore Build file
=======================
This section illustrates the functionality of MapStore Build file.
.. note:: To initialize, build and to run the application you need `Ant `__ and `Maven `__. In addition, to pull in external dependencies, you'll need `Git `__ installed. Before running in development mode or preparing the application for deployment, you need to pull in external dependencies.
The MapStore build file is a file called **build.xml** and placed in the root directory of MapStore.
Moved to the root directory of MapStore:
.. code-block:: ruby
:linenos:
you@prompt:~$ cd mapstore/
.. code-block:: ruby
:emphasize-lines: 9
../mapstore/
externals
installer
lib
mapcomposer
mapmanager
release
.gitignore
build.xml
createGitIgnore
license.txt
license_top.txt
README.md
Once inside the root you can run **ant** command with several targets.
Some of them are:
1. **ant init**
.. code-block:: ruby
you@prompt:~/mapstore$ ant init
To download RingoJs dependencies from remote Geosolutions maven repository (this is the first target to run)
.. code-block:: ruby
2. **ant debug**
.. code-block:: ruby
you@prompt:~/mapstore$ ant debug
To run **MapComposer** application in development mode. In development mode, individual scripts are available to a debugger.
If the build succeeds, you'll be able to browse to the application at http://localhost:8081/. By default, the application runs on port 8081. To change this, you can set the app.port property as follows (setting the port to 9080):
.. code-block:: ruby
you@prompt:~/mapstore$ ant -Dapp.port=9080 debug
3. **ant dist**
.. code-block:: ruby
you@prompt:~/mapstore$ ant dist
The MapStore application can be run in distribution mode.
In distribution mode, scripts are concatenated and minified.
The **dist** target will result in a directory that can be dropped in a servlet container like Apache Tomcat.
After the build you will have two new directories created:
.. code-block:: ruby
../mapstore/mapcomposer/build/mapcomposer
../mapstore/mapmanager/build/mapstore
To deploy your MapStore move the built **'mapstore'** and **'mapcomposer'** directories to your servlet container.
4. **ant war**
.. code-block:: ruby
you@prompt:~/mapstore$ ant war
Generate the web archive file, a file with .war extention.
.. code-block:: ruby
../mapstore/mapcomposer/build/mapcomposer.war
../mapstore/mapmanager/build/mapstore.war
This file can be dropped in a servlet container like Apache Tomcat.
5. **ant clean**
.. code-block:: ruby
you@prompt:~/mapstore$ ant clean
Remove all previous build