2012-11-06 18:44:50 +01:00
|
|
|
# mvn-color based on https://gist.github.com/1027800
|
2016-02-18 15:47:42 +01:00
|
|
|
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`
|
2012-11-06 18:44:50 +01:00
|
|
|
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-11-06 18:44:50 +01:00
|
|
|
# Wrapper function for Maven's mvn command.
|
2016-12-18 03:34:16 +01:00
|
|
|
mvn-color() {
|
2013-11-11 19:09:33 +01:00
|
|
|
(
|
|
|
|
# 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" \
|
2012-11-06 18:44:50 +01:00
|
|
|
-e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
|
2013-11-11 19:09:33 +01:00
|
|
|
-e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
|
|
|
|
-e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
|
2012-11-06 18:44:50 +01:00
|
|
|
-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}
|
2013-11-11 19:09:33 +01:00
|
|
|
)
|
2012-11-06 18:44:50 +01:00
|
|
|
}
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-11-06 18:44:50 +01:00
|
|
|
# Override the mvn command with the colorized one.
|
2012-11-21 18:29:09 +01:00
|
|
|
#alias mvn="mvn-color"
|
2012-11-06 18:44:50 +01:00
|
|
|
|
2012-11-06 18:39:59 +01:00
|
|
|
# aliases
|
|
|
|
alias mvncie='mvn clean install eclipse:eclipse'
|
|
|
|
alias mvnci='mvn clean install'
|
2014-06-24 16:26:12 +02:00
|
|
|
alias mvncist='mvn clean install -DskipTests'
|
2016-06-15 05:42:48 +02:00
|
|
|
alias mvncisto='mvn clean install -DskipTests --offline'
|
2012-11-06 18:39:59 +01:00
|
|
|
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'
|
2014-06-24 16:26:12 +02:00
|
|
|
alias mvnct='mvn clean test'
|
2012-11-06 18:39:59 +01:00
|
|
|
alias mvnt='mvn test'
|
|
|
|
alias mvnag='mvn archetype:generate'
|
2014-03-07 00:09:04 +01:00
|
|
|
alias mvn-updates='mvn versions:display-dependency-updates'
|
2014-03-07 00:22:37 +01:00
|
|
|
alias mvntc7='mvn tomcat7:run'
|
|
|
|
alias mvntc='mvn tomcat:run'
|
2014-03-07 00:23:37 +01:00
|
|
|
alias mvnjetty='mvn jetty:run'
|
2014-06-24 16:26:12 +02:00
|
|
|
alias mvndt='mvn dependency:tree'
|
|
|
|
alias mvns='mvn site'
|
2015-02-07 17:57:53 +01:00
|
|
|
alias mvnsrc='mvn dependency:sources'
|
|
|
|
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
|
2014-03-07 00:22:37 +01:00
|
|
|
|
2010-12-01 09:56:54 +01:00
|
|
|
function listMavenCompletions {
|
2016-12-18 03:34:16 +01:00
|
|
|
reply=(
|
2012-07-18 17:37:21 +02:00
|
|
|
# common lifecycle
|
2014-08-01 07:59:45 +02:00
|
|
|
clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-07-18 17:37:21 +02:00
|
|
|
# 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
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-07-18 17:37:21 +02:00
|
|
|
# deploy
|
|
|
|
deploy:deploy-file
|
|
|
|
# failsafe
|
|
|
|
failsafe:integration-test failsafe:verify
|
|
|
|
# install
|
|
|
|
install:install-file
|
|
|
|
# site
|
|
|
|
site:site site:deploy site:run site:stage site:stage-deploy
|
|
|
|
# surefire
|
|
|
|
surefire:test
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-07-18 17:37:21 +02:00
|
|
|
# checkstyle
|
|
|
|
checkstyle:checkstyle checkstyle:check
|
|
|
|
# javadoc
|
|
|
|
javadoc:javadoc javadoc:jar javadoc:aggregate
|
|
|
|
# jxr
|
|
|
|
jxr:jxr
|
|
|
|
# pmd
|
|
|
|
pmd:pmd pmd:cpd pmd:check pmd:cpd-check
|
|
|
|
|
|
|
|
# ant
|
|
|
|
ant:ant ant:clean
|
|
|
|
# antrun
|
|
|
|
antrun:run
|
|
|
|
# archetype
|
|
|
|
archetype:generate archetype:create-from-project archetype:crawl
|
|
|
|
# assembly
|
|
|
|
assembly:single assembly:assembly
|
|
|
|
# dependency
|
|
|
|
dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
|
|
|
|
# enforcer
|
|
|
|
enforcer:enforce
|
|
|
|
# gpg
|
|
|
|
gpg:sign gpg:sign-and-deploy-file
|
|
|
|
# help
|
|
|
|
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
|
2016-12-18 03:34:16 +01:00
|
|
|
# jgitflow
|
|
|
|
jgitflow:feature-start jgitflow:feature-finish jgitflow:release-start jgitflow:release-finish jgitflow:hotfix-start jgitflow:hotfix-finish jgitflow:build-number
|
2012-07-18 17:37:21 +02:00
|
|
|
# repository
|
|
|
|
repository:bundle-create repository:bundle-pack
|
|
|
|
# source
|
|
|
|
source:aggregate source:jar source:jar-no-fork
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-07-18 17:37:21 +02:00
|
|
|
# eclipse
|
|
|
|
eclipse:clean eclipse:eclipse
|
|
|
|
# idea
|
|
|
|
idea:clean idea:idea
|
2016-12-18 03:34:16 +01:00
|
|
|
|
2012-07-18 17:37:21 +02:00
|
|
|
# jetty
|
|
|
|
jetty:run jetty:run-exploded
|
|
|
|
# cargo
|
|
|
|
cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help
|
|
|
|
# jboss
|
|
|
|
jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy
|
|
|
|
# tomcat
|
2013-04-23 01:01:09 +02:00
|
|
|
tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy
|
2012-07-18 17:37:21 +02:00
|
|
|
# tomcat6
|
|
|
|
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
|
2016-12-18 03:34:16 +01:00
|
|
|
# tomee
|
2014-08-01 07:59:45 +02:00
|
|
|
tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
|
2014-07-07 15:12:47 +02:00
|
|
|
# spring-boot
|
|
|
|
spring-boot:run spring-boot:repackage
|
2012-07-18 17:37:21 +02:00
|
|
|
# exec
|
|
|
|
exec:exec exec:java
|
|
|
|
# versions
|
|
|
|
versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert
|
|
|
|
# scm
|
|
|
|
scm:add scm:checkin scm:checkout scm:update scm:status
|
|
|
|
# buildnumber
|
|
|
|
buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset
|
|
|
|
|
|
|
|
# war
|
|
|
|
war:war war:exploded war:inplace war:manifest
|
|
|
|
# ear
|
|
|
|
ear:ear ear:generate-application-xml
|
|
|
|
# ejb
|
|
|
|
ejb:ejb
|
|
|
|
# android
|
|
|
|
android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices
|
|
|
|
# nexus
|
|
|
|
nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download
|
|
|
|
# repository
|
|
|
|
repository:bundle-create repository:bundle-pack repository:help
|
|
|
|
|
|
|
|
# sonar
|
|
|
|
sonar:sonar
|
|
|
|
# license
|
|
|
|
license:format license:check
|
|
|
|
# hibernate3
|
|
|
|
hibernate3:hbm2ddl hibernate3:help
|
|
|
|
# liquibase
|
|
|
|
liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback
|
|
|
|
# flyway
|
|
|
|
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
|
2016-12-18 03:34:16 +01:00
|
|
|
# asciidoctor
|
|
|
|
asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip
|
2012-07-18 17:37:21 +02:00
|
|
|
# options
|
2016-09-06 05:10:42 +02:00
|
|
|
-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=
|
2012-07-18 17:37:21 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
cli:execute cli:execute-phase
|
|
|
|
archetype:generate generate-sources
|
|
|
|
cobertura:cobertura
|
2012-12-28 12:28:47 +01:00
|
|
|
-Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`
|
2016-09-14 11:10:14 +02:00
|
|
|
-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`
|
2012-07-18 17:37:21 +02:00
|
|
|
);
|
2010-12-01 09:56:54 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 18:39:59 +01:00
|
|
|
compctl -K listMavenCompletions mvn
|