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.zsh20
1 files changed, 15 insertions, 5 deletions
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 799f6fc8c..2b7683078 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -24,16 +24,18 @@ export RESET_FORMATTING=`tput sgr0`
# Wrapper function for Maven's mvn command.
mvn-color()
{
- # Filter mvn output using sed
- mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \
- -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
+ (
+ # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
+ unset LANG
+ LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
-e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
- -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
- -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \
+ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
+ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
-e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g"
# Make sure formatting is reset
echo -ne ${RESET_FORMATTING}
+ )
}
# Override the mvn command with the colorized one.
@@ -42,14 +44,22 @@ mvn-color()
# aliases
alias mvncie='mvn clean install eclipse:eclipse'
alias mvnci='mvn clean install'
+alias mvncist='mvn clean install -DskipTests'
alias mvne='mvn eclipse:eclipse'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnd='mvn deploy'
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 mvndt='mvn dependency:tree'
+alias mvns='mvn site'
function listMavenCompletions {
reply=(