This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new 55aa5325 YETUS-1259. Support detecting Maven Wrapper (#361)
55aa5325 is described below

commit 55aa5325c64e4a5e88a36d9c8edc2d3c1d1e17e4
Author: Cheng Pan <[email protected]>
AuthorDate: Tue Feb 10 21:55:33 2026 +0800

    YETUS-1259. Support detecting Maven Wrapper (#361)
---
 precommit/src/main/shell/plugins.d/maven.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/precommit/src/main/shell/plugins.d/maven.sh 
b/precommit/src/main/shell/plugins.d/maven.sh
index 5d4239a2..ccc8bc65 100755
--- a/precommit/src/main/shell/plugins.d/maven.sh
+++ b/precommit/src/main/shell/plugins.d/maven.sh
@@ -16,10 +16,12 @@
 
 declare -a MAVEN_ARGS
 
-if [[ -z "${MAVEN_HOME:-}" ]]; then
-  MAVEN=mvn
-else
+if [[ -e "${BASEDIR}/mvnw" ]]; then
+  MAVEN=${BASEDIR}/mvnw
+elif [[ -n "${MAVEN_HOME:-}" ]]; then
   MAVEN=${MAVEN_HOME}/bin/mvn
+else
+  MAVEN=mvn
 fi
 
 MAVEN_CUSTOM_REPOS=false
@@ -78,7 +80,7 @@ function maven_ws_replace
 function maven_usage
 {
   maven_ws_replace
-  yetus_add_option "--mvn-cmd=<file>" "The 'mvn' command to use (default 
\${MAVEN_HOME}/bin/mvn, or 'mvn')"
+  yetus_add_option "--mvn-cmd=<file>" "The 'mvn' command to use (default 
\${BASEDIR}/mvnw, \${MAVEN_HOME}/bin/mvn, or 'mvn')"
   yetus_add_option "--mvn-custom-repos" "Use per-project maven repos"
   yetus_add_option "--mvn-custom-repos-dir=<dir>" "Location of repos, default 
is '${MAVEN_CUSTOM_REPOS_DIR}'"
   yetus_add_option "--mvn-deps-order=<bool>" "Disable maven's auto-dependency 
module ordering (Default: '${MAVEN_DEPENDENCY_ORDER}')"

Reply via email to