diff options
Diffstat (limited to 'plugins/mvn')
-rw-r--r-- | plugins/mvn/README.md | 33 | ||||
-rw-r--r-- | plugins/mvn/mvn.plugin.zsh | 70 |
2 files changed, 70 insertions, 33 deletions
diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md new file mode 100644 index 000000000..ffc5f6832 --- /dev/null +++ b/plugins/mvn/README.md @@ -0,0 +1,33 @@ +## Introduction + +The [mvn plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn) provides many +[useful aliases](#aliases) as well as completion for the `mvn` command. + +Enable it by adding `mvn` to the plugins array in your zshrc file: +```zsh +plugins=(... mvn) +``` + +## Aliases + +| Alias | Command | +|:---------------------|:------------------------------------------------| +| `mvncie` | `mvn clean install eclipse:eclipse` | +| `mvnci` | `mvn clean install` | +| `mvncist` | `mvn clean install -DskipTests` | +| `mvncisto` | `mvn clean install -DskipTests --offline` | +| `mvne` | `mvn eclipse:eclipse` | +| `mvnd` | `mvn deploy` | +| `mvnp` | `mvn package` | +| `mvnc` | `mvn clean` | +| `mvncom` | `mvn compile` | +| `mvnct` | `mvn clean test` | +| `mvnt` | `mvn test` | +| `mvnag` | `mvn archetype:generate` | +| `mvn-updates` | `mvn versions:display-dependency-updates` | +| `mvntc7` | `mvn tomcat7:run` | +| `mvnjetty` | `mvn jetty:run` | +| `mvndt` | `mvn dependency:tree` | +| `mvns` | `mvn site` | +| `mvnsrc` | `mvn dependency:sources` | +| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 865b15235..c5a7faa0f 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,29 +1,28 @@ # mvn-color based on https://gist.github.com/1027800 -export BOLD=`tput bold` -export UNDERLINE_ON=`tput smul` -export UNDERLINE_OFF=`tput rmul` -export TEXT_BLACK=`tput setaf 0` -export TEXT_RED=`tput setaf 1` -export TEXT_GREEN=`tput setaf 2` -export TEXT_YELLOW=`tput setaf 3` -export TEXT_BLUE=`tput setaf 4` -export TEXT_MAGENTA=`tput setaf 5` -export TEXT_CYAN=`tput setaf 6` -export TEXT_WHITE=`tput setaf 7` -export BACKGROUND_BLACK=`tput setab 0` -export BACKGROUND_RED=`tput setab 1` -export BACKGROUND_GREEN=`tput setab 2` -export BACKGROUND_YELLOW=`tput setab 3` -export BACKGROUND_BLUE=`tput setab 4` -export BACKGROUND_MAGENTA=`tput setab 5` -export BACKGROUND_CYAN=`tput setab 6` -export BACKGROUND_WHITE=`tput setab 7` -export RESET_FORMATTING=`tput sgr0` +BOLD=`tput bold` +UNDERLINE_ON=`tput smul` +UNDERLINE_OFF=`tput rmul` +TEXT_BLACK=`tput setaf 0` +TEXT_RED=`tput setaf 1` +TEXT_GREEN=`tput setaf 2` +TEXT_YELLOW=`tput setaf 3` +TEXT_BLUE=`tput setaf 4` +TEXT_MAGENTA=`tput setaf 5` +TEXT_CYAN=`tput setaf 6` +TEXT_WHITE=`tput setaf 7` +BACKGROUND_BLACK=`tput setab 0` +BACKGROUND_RED=`tput setab 1` +BACKGROUND_GREEN=`tput setab 2` +BACKGROUND_YELLOW=`tput setab 3` +BACKGROUND_BLUE=`tput setab 4` +BACKGROUND_MAGENTA=`tput setab 5` +BACKGROUND_CYAN=`tput setab 6` +BACKGROUND_WHITE=`tput setab 7` +RESET_FORMATTING=`tput sgr0` + - # Wrapper function for Maven's mvn command. -mvn-color() -{ +mvn-color() { ( # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations unset LANG @@ -37,7 +36,7 @@ mvn-color() echo -ne ${RESET_FORMATTING} ) } - + # Override the mvn command with the colorized one. #alias mvn="mvn-color" @@ -45,6 +44,7 @@ mvn-color() alias mvncie='mvn clean install eclipse:eclipse' alias mvnci='mvn clean install' alias mvncist='mvn clean install -DskipTests' +alias mvncisto='mvn clean install -DskipTests --offline' alias mvne='mvn eclipse:eclipse' alias mvnce='mvn clean eclipse:clean eclipse:eclipse' alias mvnd='mvn deploy' @@ -64,13 +64,13 @@ alias mvnsrc='mvn dependency:sources' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' function listMavenCompletions { - reply=( + reply=( # common lifecycle clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site - + # common plugins deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt - + # deploy deploy:deploy-file # failsafe @@ -81,7 +81,7 @@ function listMavenCompletions { site:site site:deploy site:run site:stage site:stage-deploy # surefire surefire:test - + # checkstyle checkstyle:checkstyle checkstyle:check # javadoc @@ -109,16 +109,18 @@ function listMavenCompletions { help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system # release release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions + # jgitflow + jgitflow:feature-start jgitflow:feature-finish jgitflow:release-start jgitflow:release-finish jgitflow:hotfix-start jgitflow:hotfix-finish jgitflow:build-number # repository repository:bundle-create repository:bundle-pack # source source:aggregate source:jar source:jar-no-fork - + # eclipse eclipse:clean eclipse:eclipse # idea idea:clean idea:idea - + # jetty jetty:run jetty:run-exploded # cargo @@ -131,7 +133,7 @@ function listMavenCompletions { tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy # tomcat7 tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy - # tomee + # tomee tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy # spring-boot spring-boot:run spring-boot:repackage @@ -169,9 +171,10 @@ function listMavenCompletions { flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate # gwt gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test - + # asciidoctor + asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip # options - -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven + -Dmaven.test.skip=true -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven -Dmaven.test.failure.ignore=true -DgroupId= -DartifactId= -Dversion= -Dpackaging=jar -Dfile= # arguments -am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X @@ -180,6 +183,7 @@ function listMavenCompletions { archetype:generate generate-sources cobertura:cobertura -Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` + -Dit.test= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi` ); } |