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