6e9424
_m2_make_goals()
6e9424
{
6e9424
  plugin=$1
6e9424
  mojos=$2
6e9424
  for mojo in $mojos
6e9424
  do
6e9424
    export goals="$goals $plugin:$mojo"
6e9424
  done
6e9424
}
6e9424
6e9424
_m2_complete()
6e9424
{
6e9424
  local cur goals
6e9424
6e9424
  COMPREPLY=()
6e9424
  cur="${COMP_WORDS[COMP_CWORD]}"
6e9424
  prev="${COMP_WORDS[COMP_CWORD-1]}"
6e9424
6e9424
  case "${prev}" in
6e9424
       -f | --file|-l|--log-file)
6e9424
              COMPREPLY=( $(compgen -f ${cur}) )
6e9424
              return 0
6e9424
       ;;
6e9424
       *);;
6e9424
  esac
6e9424
6e9424
6e9424
  goals='clean compile test install package deploy site verify'
6e9424
  if [[ ${cur} == -* ]] ; then
6e9424
     goals="$goals -am --also-make
6e9424
                   -amd --also-make-dependents
6e9424
                   -B --batch-mode
6e9424
                   -C --strict-checksums
6e9424
                   -c --lax-checksums
6e9424
                   -cpu --check-plugin-updates
6e9424
                   -D --define
6e9424
                   -e --errors
6e9424
                   -emp --encrypt-master-password
6e9424
                   -ep --encrypt-password
6e9424
                   -f --file
6e9424
                   -fae --fail-at-end
6e9424
                   -ff --fail-fast
6e9424
                   -fn --fail-never
6e9424
                   -gs --global-settings
6e9424
                   -h --help
6e9424
                   -l --log-file
6e9424
                   -N --non-recursive
6e9424
                   -npr --no-plugin-registry
6e9424
                   -npu --no-plugin-updates
6e9424
                   -nsu --no-snapshot-updates
6e9424
                   -o --offline
6e9424
                   -P --activate-profiles
6e9424
                   -pl --projects
6e9424
                   -q --quiet
6e9424
                   -rf --resume-from
6e9424
                   -s --settings
6e9424
                   -T --threads
6e9424
                   -t --toolchains
6e9424
                   -U --update-snapshots
6e9424
                   -up --update-plugins
6e9424
                   -V --show-version
6e9424
                   -v --version
6e9424
                   -X --debug
6e9424
                   -Dmaven.test.skip=true
6e9424
                   -Dmaven.compiler.source=1.5
6e9424
                   -Dmaven.compiler.source=1.6
6e9424
                   -Dmaven.compiler.source=1.7
6e9424
                   -Dmaven.compiler.target=1.5
6e9424
                   -Dmaven.compiler.target=1.6
6e9424
                   -Dmaven.compiler.target=1.7
6e9424
                   -Dproject.build.sourceEncoding=UTF-8
6e9424
                   -Dmaven.repo.local=
6e9424
                   -Dmaven.local.depmap.file=
6e9424
                   -Dmaven.local.debug=true
6e9424
                   -Dmaven.local.mode=true"
6e9424
  fi
6e9424
6e9424
  goals=$goals _m2_make_goals "eclipse" "eclipse"
6e9424
  goals=$goals _m2_make_goals "idea" "idea"
6e9424
  goals=$goals _m2_make_goals "assembly" "assembly"
6e9424
  goals=$goals _m2_make_goals "plexus" "app bundle-application bundle-runtime descriptor runtime service"
6e9424
  goals=$goals _m2_make_goals "dependency" "analyze analyze-dep-mgt analyze-only analyze-report analyze-duplicate
6e9424
                                           build-classpath copy copy-dependencies get go-offline list properties
6e9424
                                           purge-local-repository resolve resolve-plugins sources tree unpack
6e9424
                                           unpack-dependencies"
6e9424
  cur=`echo $cur | sed 's/\\\\//g'`
6e9424
  COMPREPLY=($(compgen -W "${goals}" -- ${cur} | sed 's/\\\\//g') )
6e9424
}
6e9424
6e9424
complete -F _m2_complete -o filenames mvn