Auto completion in Bash for Maven

Step 1 : Check if bash_completion in enabled in your .bashrc.
Step 2 : Add the file attached to /etc/bash_completion.d/m2.
Step 3 : Enjoy auto-completion for Maven.

The Code Lines :
complete -F _m2_complete -o filenames mvn Indicates to apply _m2_complete for command following mvn
compgenGenerate possible completion matches for word according to the options.

Share this