summaryrefslogtreecommitdiff
path: root/plugins/mvn/mvn.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mvn/mvn.plugin.zsh')
-rw-r--r--plugins/mvn/mvn.plugin.zsh16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index ee6fe2770..f367fecce 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -20,6 +20,15 @@ BACKGROUND_CYAN=$(tput setab 6)
BACKGROUND_WHITE=$(tput setab 7)
RESET_FORMATTING=$(tput sgr0)
+# if found an executable ./mvnw file execute it otherwise execute orignal mvn
+mvn-or-mvnw() {
+ if [ -x ./mvnw ] ; then
+ echo "executing mvnw instead of mvn"
+ ./mvnw "$@";
+ else
+ mvn "$@";
+ fi
+}
# Wrapper function for Maven's mvn command.
mvn-color() {
@@ -40,6 +49,9 @@ mvn-color() {
# Override the mvn command with the colorized one.
#alias mvn="mvn-color"
+# either use orignal mvn oder the mvn wrapper
+alias mvn="mvn-or-mvnw"
+
# aliases
alias mvncie='mvn clean install eclipse:eclipse'
alias mvnci='mvn clean install'
@@ -59,11 +71,13 @@ alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run'
+alias mvnboot='mvn spring-boot:run'
alias mvndt='mvn dependency:tree'
alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
+
function listMavenCompletions {
reply=(
# common lifecycle
@@ -274,3 +288,5 @@ function listMavenCompletions {
}
compctl -K listMavenCompletions mvn
+compctl -K listMavenCompletions mvn-or-mvnw
+