Skip to content

Commit

Permalink
Support mvnd in PTL
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Feb 21, 2022
1 parent e5c4e52 commit c6ff750
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions testing/trino-product-tests-launcher/bin/run-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

target="${BASH_SOURCE%/*/*}/target"

trino_version=$(./mvnw -B help:evaluate -Dexpression=pom.version -q -DforceStdout)
if command -v mvnd >/dev/null; then
# Using mvnd here can save more than 2 seconds compared to ./mvnw startup cost. This is especially important
# when invoking inspection commands like --help, env list, etc.
trino_version=$(mvnd -B help:evaluate -Dexpression=pom.version -q -DforceStdout --raw-streams)
mvn="mvnd"
else
trino_version=$(./mvnw -B help:evaluate -Dexpression=pom.version -q -DforceStdout)
mvn="./mvnw"
fi
launcher_jar="${target}/trino-product-tests-launcher-${trino_version}-executable.jar"

if ! test -x "${launcher_jar}"; then
echo "Could not find launcher jar ${launcher_jar}." >&2
echo "Run \`./mvnw clean install -pl :trino-product-tests-launcher\`" >&2
echo "Run \`${mvn} clean install -pl :trino-product-tests-launcher\`" >&2
exit 3
fi

Expand Down

0 comments on commit c6ff750

Please sign in to comment.