#!/bin/bash usage () { echo "USAGE: $0 [FLAGS]" echo "Flags:" echo " -t: Skip download of dependencies. Used for testing that a previous download succeded." echo " -h: Print this message" } is_reposilite_up () { curl -s -o /dev/null repo:80 return $? } wait_for_reposilite () { i=0 until is_reposilite_up; do i=$((i+1)) if [ $i -gt 30 ]; then return $i fi sleep 1 done return $i } should_download=1 while [ $# -ne 0 ]; do case "$1" in -t) should_download=0 ;; -h) usage; exit 0 ;; esac shift done handle_parameters wait_for_reposilite if [ $? -lt 30 ]; then if [ $should_download -eq 1 ]; then for pom in /poms/*; do mvn -P central \ -Dos.detected.classifier=linux-x86_64 \ -f $pom \ dependency:go-offline \ dependency:resolve -Dclassifier=javadoc mvn -P central \ -Dos.detected.classifier=linux-x86_64 \ -f $pom \ dependency:sources done fi echo "Generating quarkus project" mvn -P central \ io.quarkus.platform:quarkus-maven-plugin::create \ -DprojectGroupId=com.example \ -DprojectArtifactId=quarkus-test RET=$? if [ $RET -eq 0 ]; then cd quarkus-test echo "Building quarkus project" mvn package RET=$? fi exit $RET else echo "Can't connect to repository" exit 255 fi