Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
9bd0ac9b
Unverified
Commit
9bd0ac9b
authored
Oct 11, 2021
by
Arthur Maltson
Committed by
GitHub
Oct 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(mvn): support using `mvnw` in multi-module projects (#9413)
parent
f82aa819
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
292 additions
and
285 deletions
+292
-285
mvn.plugin.zsh
plugins/mvn/mvn.plugin.zsh
+292
-285
No files found.
plugins/mvn/mvn.plugin.zsh
View file @
9bd0ac9b
# Calls
./mvnw if found
, otherwise execute the original mvn
# Calls
mvnw if found in the current project
, otherwise execute the original mvn
mvn-or-mvnw
()
{
if
[
-x
./mvnw
]
;
then
echo
"executing mvnw instead of mvn"
./mvnw
"
$@
"
else
command
mvn
"
$@
"
local dir
=
"
$PWD
"
while
[[
!
-x
"
$dir
/mvnw"
&&
"
$dir
"
!=
/
]]
;
do
dir
=
"
${
dir
:h
}
"
done
if
[[
-x
"
$dir
/mvnw"
]]
;
then
echo
"Running
\`
$dir
/mvnw
\`
..."
>
&2
"
$dir
/mvnw"
"
$@
"
return
$?
fi
command
mvn
"
$@
"
}
# Wrapper function for Maven's mvn command. Based on https://gist.github.com/1027800
...
...
@@ -17,6 +23,7 @@ mvn-color() {
local
TEXT_BLUE
=
$(
echoti setaf 4
)
local
TEXT_WHITE
=
$(
echoti setaf 7
)
local
RESET_FORMATTING
=
$(
echoti sgr0
)
(
# Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
unset
LANG
...
...
@@ -33,7 +40,7 @@ mvn-color() {
)
}
# either use orignal mvn or the mvn wrapper
# either use orig
i
nal mvn or the mvn wrapper
alias
mvn
=
"mvn-or-mvnw"
# Run mvn against the pom found in a project's root directory (assumes a git repo)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment