blob: 184e7e05bc18c9937f445e8277839f7a320ba36b [file] [log] [blame]
# 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](https://sdkman.io/) 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)](https://maven.apache.org/download.cgi).
### 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.
```bash
[INFO] Building tar: /path-to-project/baremaps-cli/target/apache-baremaps-0.7.2-SNAPSHOT-incubating-bin.tar.gz
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for baremaps 0.7.2-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`.
```bash
tar -xvf ./baremaps-cli/target/apache-baremaps-0.7.2-SNAPSHOT-incubating-bin.tar.gz
export PATH=$PATH:`pwd`/apache-baremaps-0.7.2-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](/documentation/getting-started/installing-postgis/) if you plan to work with vector tiles.
If you want to work on [Geocoding](/documentation/examples/geocoding/) or
[IP to location](/documentation/examples/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.