Skip to content

Commit 55aa532

Browse files
authored
YETUS-1259. Support detecting Maven Wrapper (#361)
1 parent 2a831e7 commit 55aa532

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • precommit/src/main/shell/plugins.d

precommit/src/main/shell/plugins.d/maven.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
declare -a MAVEN_ARGS
1818

19-
if [[ -z "${MAVEN_HOME:-}" ]]; then
20-
MAVEN=mvn
21-
else
19+
if [[ -e "${BASEDIR}/mvnw" ]]; then
20+
MAVEN=${BASEDIR}/mvnw
21+
elif [[ -n "${MAVEN_HOME:-}" ]]; then
2222
MAVEN=${MAVEN_HOME}/bin/mvn
23+
else
24+
MAVEN=mvn
2325
fi
2426

2527
MAVEN_CUSTOM_REPOS=false
@@ -78,7 +80,7 @@ function maven_ws_replace
7880
function maven_usage
7981
{
8082
maven_ws_replace
81-
yetus_add_option "--mvn-cmd=<file>" "The 'mvn' command to use (default \${MAVEN_HOME}/bin/mvn, or 'mvn')"
83+
yetus_add_option "--mvn-cmd=<file>" "The 'mvn' command to use (default \${BASEDIR}/mvnw, \${MAVEN_HOME}/bin/mvn, or 'mvn')"
8284
yetus_add_option "--mvn-custom-repos" "Use per-project maven repos"
8385
yetus_add_option "--mvn-custom-repos-dir=<dir>" "Location of repos, default is '${MAVEN_CUSTOM_REPOS_DIR}'"
8486
yetus_add_option "--mvn-deps-order=<bool>" "Disable maven's auto-dependency module ordering (Default: '${MAVEN_DEPENDENCY_ORDER}')"

0 commit comments

Comments
 (0)