#!/bin/bash
set -eou pipefail

# Build instructions from:
#   http://hirt.se/blog/?p=947

# Set up third-party repository server, and give it some time to initialize
cd releng/third-party
mvn p2:site
mvn jetty:run &
PID=$!

sleep 20

# Build and install core libraries
cd ../../core
#mvn install 
mvn install -DskipTests -Dspotbugs.skip=true # <--- This is faster

# Build JMC itself
cd ..
#mvn clean install # <--- This currently fails :(
mvn clean install -DskipTests -Dspotbugs.skip=true # <--- This is faster

# Third-party repository server is not needed anymore
kill $PID
