Documentation
How to Build with Maven

How to Build with Maven

This guide describes the basics of compiling Baremaps from source. In order to run Apache Baremaps, you first need to install Java 17 or a later version. SDKMAN (opens in a new tab) provides a convenient Command Line Interface (CLI) to install and upgrade Java. We also suggest you use the most recent version of Maven to compile (at least 3.x.x) (opens in a new tab).

Linux or OSX

To start you can run the command ./mvnw clean package -DskipTests from the root folder of the Baremaps project. Upon successful compilation you should see something similar to the following output in your terminal.

[INFO] Building tar: /path-to-project/baremaps-cli/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin.tar.gz
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for baremaps <version>-SNAPSHOT:
[INFO]
[INFO] baremaps ........................................... SUCCESS [  4.172 s]
[INFO] baremaps-core ...................................... SUCCESS [ 59.018 s]
[INFO] baremaps-benchmark ................................. SUCCESS [  1.775 s]
[INFO] baremaps-ogcapi .................................... SUCCESS [  9.796 s]
[INFO] baremaps-server .................................... SUCCESS [  0.787 s]
[INFO] baremaps-cli ....................................... SUCCESS [ 20.687 s]
[INFO] ------------------------------------------------------------------------

It is important to note the first line in the output above that notes where the location of the baremaps-cli binary file resides. Referencing the location of the baremaps-cli binary file, you can run the following to untar and place Baremaps into your PATH.

tar -xvf ./baremaps-cli/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin.tar.gz -C target/
export PATH=$PATH:`pwd`/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin/bin

Note: Make sure to replace the version number in the above commands with the version number of the release you are using.

Executing the baremaps command should now result in an output similar to the following:

Usage: baremaps [-V] [COMMAND]
A toolkit for producing vector tiles.
  -V, --version   Print version info.
Commands:
  workflow  Manage a workflow.
  database  Database commands.
  map       Map commands.
  geocoder  Geocoder commands (experimental).
  iploc     IP to location commands (experimental).
  ogcapi    OGC API server (experimental).

From here, head into Installing PostGIS if you plan to work with vector tiles.

If you want to work on Geocoding or IP to location, head directly into the related examples.

Windows

If you are using Windows, you will need to use mvnw.cmd instead of ./mvnw and use set instead of export to set the environment variable.

Important

If your build is taking a long time, it might be due to the presence of large data/map files. To identify then delete them run:

git clean -dnx
cd examples/
git clean -dfx