How to build a Spring Boot project on your Raspberry Pi Zero W with Maven

  java, linux, raspberry-pi
# install maven and git
sudo apt-get update && sudo apt-get install -y maven git

verify install

pi@door:~ $ git --version
git version 2.20.1

pi@door:~ $ mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-armhf/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.4.79+", arch: "arm", family: "unix"

 note: your maven installation and config is at
/usr/share/maven/conf/settings.xml

# clone your project
git clone https://path/to/project

# go into project dir
cd project

# set git credential store
git config credential.helper store

# enter login/pass one more time
git pull

# do a build
mvn clean compile package -Dmaven.test.skip=true

# and wait 10 minutes to download all the dependencies

Extra: If you use your own custom nexus repository for faster dependency download on your network, you can edit the maven settings.xml and have more fun:

sudo nano /usr/share/maven/conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
 <servers>
    <server>
      <id>myownnexus</id>
      <username>mynexuslogin</username>
      <password>passwordgoeshere</password>
    </server>
 </servers>
 <mirrors>
    <mirror>
      <id>myownnexus</id>
      <name>myownnexus</name>
      <url>https://nexus.mydomain.com/repository/maven-public/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  <localRepository>/home/pi/.m2/repository</localRepository>
</settings>