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