Commit d0a0421e authored by Marc Cornellà's avatar Marc Cornellà
Browse files

mvn: sort aliases and improve comments and README

parent 006b8820
...@@ -10,26 +10,45 @@ plugins=(... mvn) ...@@ -10,26 +10,45 @@ plugins=(... mvn)
## Aliases ## Aliases
The plugin aliases mvn to a either calls `mvnw` ([Maven Wrapper](https://github.com/takari/maven-wrapper))
if it's found, or the mvn command otherwise.
| Alias | Command | | Alias | Command |
|:---------------------|:------------------------------------------------| |:---------------------|:------------------------------------------------|
| `mvncie` | `mvn clean install eclipse:eclipse` | | `mvn!` | `mvn -f <root>/pom.xml` |
| `mvnag` | `mvn archetype:generate` |
| `mvnboot` | `mvn spring-boot:run` |
| `mvnc` | `mvn clean` |
| `mvncd` | `mvn clean deploy` |
| `mvnce` | `mvn clean eclipse:clean eclipse:eclipse` |
| `mvnci` | `mvn clean install` | | `mvnci` | `mvn clean install` |
| `mvncie` | `mvn clean install eclipse:eclipse` |
| `mvncini` | `mvn clean initialize` |
| `mvncist` | `mvn clean install -DskipTests` | | `mvncist` | `mvn clean install -DskipTests` |
| `mvncisto` | `mvn clean install -DskipTests --offline` | | `mvncisto` | `mvn clean install -DskipTests --offline` |
| `mvne` | `mvn eclipse:eclipse` |
| `mvncv` | `mvn clean verify` |
| `mvnd` | `mvn deploy` |
| `mvncd` | `mvn clean deploy` |
| `mvnp` | `mvn package` |
| `mvnc` | `mvn clean` |
| `mvncom` | `mvn compile` | | `mvncom` | `mvn compile` |
| `mvncp` | `mvn clean package` |
| `mvnct` | `mvn clean test` | | `mvnct` | `mvn clean test` |
| `mvnt` | `mvn test` | | `mvncv` | `mvn clean verify` |
| `mvnag` | `mvn archetype:generate` | | `mvncvst` | `mvn clean verify -DskipTests` |
| `mvn-updates` | `mvn versions:display-dependency-updates` | | `mvnd` | `mvn deploy` |
| `mvntc7` | `mvn tomcat7:run` | | `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
| `mvnjetty` | `mvn jetty:run` |
| `mvndt` | `mvn dependency:tree` | | `mvndt` | `mvn dependency:tree` |
| `mvne` | `mvn eclipse:eclipse` |
| `mvnjetty` | `mvn jetty:run` |
| `mvnp` | `mvn package` |
| `mvns` | `mvn site` | | `mvns` | `mvn site` |
| `mvnsrc` | `mvn dependency:sources` | | `mvnsrc` | `mvn dependency:sources` |
| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | | `mvnt` | `mvn test` |
| `mvntc` | `mvn tomcat:run` |
| `mvntc7` | `mvn tomcat7:run` |
| `mvn-updates` | `mvn versions:display-dependency-updates` |
## mvn-color
It's a function that wraps the mvn command to colorize it's output. Since Maven 3.5.0
the mvn command adds colored output, so this function will be soon removed from the
plugin.
It also has a bug where it won't print when mvn prompts for user input, _e.g._ when
using `archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052).
# if found an executable ./mvnw file execute it otherwise execute orignal mvn # Calls ./mvnw if found, otherwise execute the original mvn
mvn-or-mvnw() { mvn-or-mvnw() {
if [ -x ./mvnw ]; then if [ -x ./mvnw ]; then
echo "executing mvnw instead of mvn" echo "executing mvnw instead of mvn"
...@@ -8,8 +8,7 @@ mvn-or-mvnw() { ...@@ -8,8 +8,7 @@ mvn-or-mvnw() {
fi fi
} }
# Wrapper function for Maven's mvn command. # Wrapper function for Maven's mvn command. Based on https://gist.github.com/1027800
# based on https://gist.github.com/1027800
mvn-color() { mvn-color() {
local BOLD=$(echoti bold) local BOLD=$(echoti bold)
local TEXT_RED=$(echoti setaf 1) local TEXT_RED=$(echoti setaf 1)
...@@ -34,40 +33,40 @@ mvn-color() { ...@@ -34,40 +33,40 @@ mvn-color() {
) )
} }
# either use orignal mvn oder the mvn wrapper # either use orignal mvn or the mvn wrapper
alias mvn="mvn-or-mvnw" alias mvn="mvn-or-mvnw"
# Run mvn against the pom found in a project's root directory (assumes a git repo) # Run mvn against the pom found in a project's root directory (assumes a git repo)
alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml' alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml'
# aliases # aliases
alias mvncini='mvn clean initialize' alias mvnag='mvn archetype:generate'
alias mvncie='mvn clean install eclipse:eclipse' alias mvnboot='mvn spring-boot:run'
alias mvnc='mvn clean'
alias mvncd='mvn clean deploy'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnci='mvn clean install' alias mvnci='mvn clean install'
alias mvncp='mvn clean package' alias mvncie='mvn clean install eclipse:eclipse'
alias mvncini='mvn clean initialize'
alias mvncist='mvn clean install -DskipTests' alias mvncist='mvn clean install -DskipTests'
alias mvncisto='mvn clean install -DskipTests --offline' alias mvncisto='mvn clean install -DskipTests --offline'
alias mvne='mvn eclipse:eclipse' alias mvncom='mvn compile'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse' alias mvncp='mvn clean package'
alias mvnct='mvn clean test'
alias mvncv='mvn clean verify' alias mvncv='mvn clean verify'
alias mvncvst='mvn clean verify -DskipTests' alias mvncvst='mvn clean verify -DskipTests'
alias mvnd='mvn deploy' alias mvnd='mvn deploy'
alias mvncd='mvn clean deploy' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
alias mvnp='mvn package'
alias mvnc='mvn clean'
alias mvncom='mvn compile'
alias mvnct='mvn clean test'
alias mvnt='mvn test'
alias mvnag='mvn archetype:generate'
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 mvndt='mvn dependency:tree'
alias mvne='mvn eclipse:eclipse'
alias mvnjetty='mvn jetty:run'
alias mvnp='mvn package'
alias mvns='mvn site' alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources' alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' alias mvnt='mvn test'
alias mvntc='mvn tomcat:run'
alias mvntc7='mvn tomcat7:run'
alias mvn-updates='mvn versions:display-dependency-updates'
function listMavenCompletions { function listMavenCompletions {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment