Skip to content

Building and deploying

Maven is the main tool for building and deploying a complete application. It takes care of:

  • building the java libraries and webapp(s)
  • calling NPM as needed to take care of the frontend builds
  • launching both backend and frontend test suites
  • creating the final war for deploy into a J2EE container (e.g. Tomcat)

To create the final war, you have several options:

  • full build, including submodules and frontend (e.g. GeoStore)

./ [version_identifier]

Where version_identifier is an optional identifier of the generated war that will be shown in the settings panel of the application.

  • fast build (will use the last compiled version of submodules and compiled frontend)

mvn clean install -Dmapstore2.version=[version_identifier]

  • release build (produces also the binary)

mvn clean install -Dmapstore2.version=[version_identifier] -Prelease

Where [version_identifier] is the version you want to export (e.g. 2020.01.00). This version name will appear in "Settings --> version information" and used to create handle bundles version (i.e. caching).

Building the documentation

MapStore uses JSDoc to annotate the components, so the documentation can be automatically generated using docma. Please see for further information about code documentation.

Refer to the existing files to follow the documentation style:

To install docma:

npm install -g docma

While developing you can generate the documentation to be accessible in the local machine by:

npm run doctest

The resulting doc will be accessible from http://localhost:8081/mapstore/docs/

For the production deploy a different npm task must be used:

npm run doc

The documentation will be accessible from the /mapstore/docs/ path

The generated folders can be removed with:

npm run cleandoc

Undestanding frontend building tools

Frontend building is delegated to NPM and so leverages the NodeJS ecosystem.

In particular:

Index of main npm scripts

  • download dependencies and init developer environment

npm install

  • start development instance

npm start

  • start development instance with examples

npm run examples

  • run test suite once

npm test

  • run continuous test suite running

npm run continuoustest

  • run single build / bundling

npm run compile

  • run ESLint checks

npm run lint

  • run tests from Maven

npm run mvntest

  • build for travis

npm run travis

Including the printing engine in your build

The MapStore printing engine is not included in official builds by default.

To build your own version of MapStore with the printing module included, you can enable the printing profile:

./ [version_identifier] -Pprinting

It is also possible to build only the printing extension as a zip (to be unzipped on your deployed MapStore). To do that:

mvn clean install -Pprintingbundle

The zip bundle will be in printing/target/