Maven 2 is in the repositories, but not Maven 3. How do I properly install Maven 3? Guides that I found don't really work properly.
I am using Natty, but I am sure this won't change anything.
Maven 2 is in the repositories, but not Maven 3. How do I properly install Maven 3? Guides that I found don't really work properly.
I am using Natty, but I am sure this won't change anything.
Maven3 is the default in Ubuntu 12.04 (precise)
Maven2 is the latest in the repositories for 11.10.
PPAs for maven3 seem rather scarce - here is one for maverick - although not the very latest version available.
The best advice is to stay with the stable version available for your distro version.
However if you like to keep up-to-date yourself it is very straightforward to download the code and install yourself.
Download the .tar.gz file from here and follow the installation guidance on the same web-page
Here is a maven3 PPA that worked fine for me on 64 bit Ubuntu 11.10
If you have maven2 already installed from canonical repos this will not replace it but give you a mvn3 binary.
If you prefer to have the binary called mvn instead of mvn3 you can simply do the following:
Source
The question is old, but gold. I had to find a solution today. Here we go. There is no need to use an unsecure repository, because maven3 is already included in the Ubuntu repos. A solution at Ubuntu 14.04 LTS will be like:
sudo apt-get install maven
sudo update-alternatives --config mvn
With the 2nd command you're asked to set the used version. You can distinguish the correct directories by selecting the path where maven2 is NOT part of it.
In my case I had to select 1
With the issued command
mvn -v
you may verify, if the setting succeeded and whether you selected the correct version. Below you have an example of the returned values.Hope this helps you a bit.
I have made a new script that should not only install Maven + add it to bin, but picks up if you are using Ubuntu as a VirtualBox guest and then attempts to mount existing '.m2' and maven folder which may/may not contain existing settings.
Maven remains the same if it runs on Windows or Unix, so you can use same Maven between both is this is your VirtualBox setup...
PS. Note the build of scripts that can mount/unmount shared folders from the /usr/local/bin :)
Here is maven3 PPA which can resolve this issue.
Follow the installation:
And now you have installed maven3:
Link to Launchpad
I upgraded but got a classnotfound error. To fix this:
After spending some time trying various combinations , I found that this is because I have both M2_HOME and M3_HOME set in my environment variables.Once I removed M2_HOME from my environment variables, I could get this working back again.May be this could save some serious time for some one.
Download maven from maven official site and extract.
Move the application directory to /usr/local
Make a soft link in /usr/bin for universal access of mvn
Verifify mvn installation
If you are not comfortable with a PPA (personal package archive) where you have no assurance of the provenance this is an alternative.
From a security perspective if you don't know where it came from don't install it.
In my linked article I retrieve the latest file from apache which is a known and trusted source. You can get the latest version
then install it from
as outlined in the link above and my post on