#!/usr/bin/env bash # Starts the real application with no spring.mail.host (application.yml is not read) and keeps the console output # Spring Boot prints when it cannot start. Writes output/10-no-mail-host.txt. set -uo pipefail cd "$(dirname "$0")/.." mkdir -p output mvn -B -q -DskipTests package >/dev/null 2>&1 || { echo "build failed"; exit 1; } java -jar target/email-1.0.0.jar --spring.config.location=optional:file:./does-not-exist.yml --spring.main.banner-mode=off \ 2>&1 | sed -n '/APPLICATION FAILED TO START/,$p' | sed 's/\x1b\[[0-9;]*m//g' > output/10-no-mail-host.txt cat output/10-no-mail-host.txt