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:
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 :)
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.
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:
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
Hope this helps you a bit.