Adding tab completition to Maven3 under Ubuntu
Maven 3 was released recently (depending on your definition of recent), but is not yet packaged for Ubuntu. This is generally not a problem, since the installation instructions are easy to follow (alternatively here are the installation instructions from the Sonatype maven book), but you don’t get tab completion in your terminal, which is quite a bummer, since I don’t know how to write correctly without a spellchecker.
Fortunately the steps to add it are simple:
- Download an older Maven2 package
- Extract from it the
/etc/bash_completion.d/maven2file (take care not to install the package by mistake)
- Put the extracted file into
- Restart your terminal
These steps should also work with other Linux distributions if they have bash-completion installed.