Skip to content

Instantly share code, notes, and snippets.

@derTobsch
Created April 21, 2017 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derTobsch/688b4e38b7857850b2c86d05e3c78e86 to your computer and use it in GitHub Desktop.
Save derTobsch/688b4e38b7857850b2c86d05e3c78e86 to your computer and use it in GitHub Desktop.
Enhancemants with maven: use wrapper if available - some shortcuts
# mvn
notified_maven() {
if [ -x ./mvnw ]; then
echo "## Maven Wrapper"
./mvnw $@ -Dspring.output.ansi.enabled=ALWAYS
else
echo "## Global Maven"
mvn $@ -Dspring.output.ansi.enabled=ALWAYS
fi
if [ $? -eq 0 ]; then
notify-send --icon=face-cool "`basename $(pwd)`: mvn $*" "Build SUCCESS"
else
notify-send --icon=face-crying "`basename $(pwd)`: mvn $*" "Build FAILED"
fi
}
alias mvnn=notified_maven
alias mvnw-add="mvn -N io.takari:maven:wrapper -Dmaven=3.5.0"
alias mci='notified_maven clean install'
alias mcp='notified_maven clean package'
alias mcv='notified_maven clean verify'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment