#!/usr/bin/env bash # What a Flyway 12 + PostgreSQL project does without the separate flyway-database-postgresql module. set -uo pipefail HERE="$(cd "$(dirname "$0")/.." && pwd)" OUT="$HERE/output/14-missing-flyway-database-module.txt" WORK="$(mktemp -d)" mkdir -p "$WORK/m" && cp -r "$HERE/pom.xml" "$HERE/src" "$WORK/m/" cd "$WORK/m" python3 - <<'PY' import re s=open('pom.xml').read() s=s.replace(''' org.flywaydb flyway-database-postgresql ''','',1) open('pom.xml','w').write(s) PY { echo "flyway-database-postgresql removed from the application dependencies" mvn -B -q test -Dtest=JooqSliceTest 2>&1 | grep -E 'Caused by: org.flywaydb.core.api.FlywayException|Tests run:.*Fail' | sed -E 's/^[0-9T:.+-]+ +(WARN|ERROR|INFO) +[0-9]+ --- \[[^]]*\] \[[^]]*\] //' | awk '!s[$0]++' | cut -c1-300 | head -6 } > "$OUT" cd "$HERE"; rm -rf "$WORK" cat "$OUT"