Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Deprecation Warning

This plugin has been removed from the current Maven distribution, it is not maintained by the Maven team anymore. Please check the Plugins History page to find out the last Maven version that included this plugin.

Maven Shell Plugin

This plug-in provides the ability to generate shell script files that allows for tab completion.

For more information on the functionality provided by this plugin, please see the Goals document.

For more information on how to customise the functionality provided by this plugin, please see the properties document.

Bash Completion

You must add this to your bash_completion.d directory:

have maven &&
_maven() {
    cf=target/maven_goals.bash
    cur=${COMP_WORDS[$COMP_CWORD]}
    prev=${COMP_WORDS[COMP_CWORD-1]}

    case "$prev" in
        -D|--define|-d|--dir|-f|--find|-p|--pom)
            return 0
            ;;
    esac
             
    if [[ "$cur" == -* ]]; then
        COMPREPLY=( $(compgen -W '--debug --define --dir --emacs \
            --exception --find --goals --help --info --nobanner \
            --offline --plugin-help --pom --quiet --usage --version \
            -D -E -P -X -b -d -e -f -g -h -i -o -p -q -u -v' -- $cur) )
        return 0
    fi

    if [ ! -r "$cf" ] ; then
        echo
        echo "# The bash completion file does not exist or is not readable"
        echo "# Please generate it with maven shell:bash"
        return 0
    fi
    
    COMPREPLY=( $(  cat "$cf" | grep "^$cur" ) )
}

[ "$have" ] && complete -F _maven maven