[FLINK-32834] Decouple low-level scripts from maven-utlls
- ease usage by reducing number of parameters
- avoid CI-exclusive maven-utils
- use mvnw by default
diff --git a/tools/ci/compile.sh b/tools/ci/compile.sh
index 11e1e22..2715010 100755
--- a/tools/ci/compile.sh
+++ b/tools/ci/compile.sh
@@ -97,11 +97,11 @@
echo "============ Checking bundled dependencies marked as optional ============"
-${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT "$CI_DIR" || exit $?
+MVN=run_mvn ${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT || exit $?
echo "============ Checking scala suffixes ============"
-${CI_DIR}/verify_scala_suffixes.sh "$CI_DIR" || exit $?
+MVN=run_mvn ${CI_DIR}/verify_scala_suffixes.sh || exit $?
echo "============ Checking shaded dependencies ============"
@@ -117,7 +117,7 @@
find $MVN_VALIDATION_DIR
# We use a different Scala version with Java 17
if [[ ${PROFILE} != *"jdk17"* ]]; then
- ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT $CI_DIR $MVN_VALIDATION_DIR || exit $?
+ MVN=run_mvn ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT $MVN_VALIDATION_DIR || exit $?
fi
exit $EXIT_CODE
diff --git a/tools/ci/license_check.sh b/tools/ci/license_check.sh
index 3b3e026..4f2aebb 100755
--- a/tools/ci/license_check.sh
+++ b/tools/ci/license_check.sh
@@ -18,12 +18,11 @@
################################################################################
MVN_CLEAN_COMPILE_OUT=$1
-CI_DIR=$2
-FLINK_DEPLOYED_ROOT=$3
+FLINK_DEPLOYED_ROOT=$2
-source "${CI_DIR}/maven-utils.sh"
+MVN=${MVN:-./mvnw}
-run_mvn -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.licensecheck.LicenseChecker -Dexec.args="$MVN_CLEAN_COMPILE_OUT $(pwd) $FLINK_DEPLOYED_ROOT"
+$MVN -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.licensecheck.LicenseChecker -Dexec.args="$MVN_CLEAN_COMPILE_OUT $(pwd) $FLINK_DEPLOYED_ROOT"
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
diff --git a/tools/ci/verify_bundled_optional.sh b/tools/ci/verify_bundled_optional.sh
index bcacc70..34fff60 100755
--- a/tools/ci/verify_bundled_optional.sh
+++ b/tools/ci/verify_bundled_optional.sh
@@ -19,17 +19,16 @@
## Checks that all bundled dependencies are marked as optional in the poms
MVN_CLEAN_COMPILE_OUT=$1
-CI_DIR=$2
-source "${CI_DIR}/maven-utils.sh"
+MVN=${MVN:-./mvnw}
dependency_plugin_output=/tmp/optional_dep.txt
-run_mvn dependency:tree -B > "${dependency_plugin_output}"
+$MVN dependency:tree -B > "${dependency_plugin_output}"
cat "${dependency_plugin_output}"
-run_mvn -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.optional.ShadeOptionalChecker -Dexec.args="${MVN_CLEAN_COMPILE_OUT} ${dependency_plugin_output}"
+$MVN -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.optional.ShadeOptionalChecker -Dexec.args="${MVN_CLEAN_COMPILE_OUT} ${dependency_plugin_output}"
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
diff --git a/tools/ci/verify_scala_suffixes.sh b/tools/ci/verify_scala_suffixes.sh
index 37581b4..4c5cc38 100755
--- a/tools/ci/verify_scala_suffixes.sh
+++ b/tools/ci/verify_scala_suffixes.sh
@@ -37,17 +37,15 @@
#
# The script uses 'mvn dependency:tree -Dincludes=org.scala-lang' to list Scala
# dependent modules.
-CI_DIR=$1
+MVN=${MVN:-./mvnw}
echo "--- Flink Scala Dependency Analyzer ---"
echo "Analyzing modules for Scala dependencies using 'mvn dependency:tree'."
echo "If you haven't built the project, please do so first by running \"mvn clean install -DskipTests\""
-source "${CI_DIR}/maven-utils.sh"
-
dependency_plugin_output=/tmp/dep.txt
-run_mvn dependency:tree -Dincludes=org.scala-lang,:*_2.1*:: ${MAVEN_ARGUMENTS} > "${dependency_plugin_output}"
+$MVN dependency:tree -Dincludes=org.scala-lang,:*_2.1*:: ${MAVEN_ARGUMENTS} > "${dependency_plugin_output}"
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
@@ -58,7 +56,7 @@
exit 1
fi
-run_mvn -pl tools/ci/flink-ci-tools exec:java exec:java -Dexec.mainClass=org.apache.flink.tools.ci.suffixcheck.ScalaSuffixChecker -Dexec.args="${dependency_plugin_output} $(pwd)"
+$MVN -pl tools/ci/flink-ci-tools exec:java exec:java -Dexec.mainClass=org.apache.flink.tools.ci.suffixcheck.ScalaSuffixChecker -Dexec.args="${dependency_plugin_output} $(pwd)"
EXIT_CODE=$?
if [ $EXIT_CODE == 0 ]; then