apt-get install "maven" or "maven3"

I need some clarification on how to install the latest version of maven. When I run this command on a new Ubuntu 16.04 server machine (I haven't installed maven yet) I get the following message:

vagrant@vagrant:~$ mvn
The program 'mvn' is currently not installed. You can install it by typing:
sudo apt install maven

But I see other forum posts saying to install "maven3". So my question is what is the difference between apt-get install "maven" and "maven3"? Does "maven" install an older version or does this just point to whatever the latest version is? Should I just use "maven3" instead?

If this helps, I am writing this script to set up a new developer workstation on Ubuntu 16.04, starting from scratch.


Solution 1:

apt-cache show maven | grep Version for me shows

Version: 3.0.5-1

so the maven package is a reasonably recent version of maven 3.x.x.

apt-cache show maven3 for me yields

N: Unable to locate package maven3
E: No packages found

so trying to install maven3 will probably fail unless you have a non-standard set of repos on your search list.

Also see https://packages.debian.org/search?keywords=maven