Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can not install mvn 3.3.3 on ubuntu 14.04

Tags:

maven

ubuntu

I am using Ubuntu 14.04. I need to run mvn 3.3.3. Currently, the installed mvn version 3.0.5. When I enter

sudo apt-get install maven

it says maven is already the newest version

is there a way to force install mvn 3.3.3?

like image 474
bhomass Avatar asked Nov 09 '15 19:11

bhomass


3 Answers

Add a ppa containing maven 3.3.3, for example this one by executing these instructions on the command-line:

sudo apt-get purge maven maven2 maven3
sudo add-apt-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3
like image 57
Gerard Rozsavolgyi Avatar answered Nov 22 '22 09:11

Gerard Rozsavolgyi


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

\#identify the latest version of maven
    latest=$(curl http://www-us.apache.org/dist/maven/maven-3/ | tac | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,3\}[0-9]\).*/\1/p' | head -1)
\#download it
    wget http://www-us.apache.org/dist/maven/maven-3/$latest/binaries/apache-maven-$latest-bin.tar.gz

then install it from

\#Unpack it
    sudo tar -zxf apache-maven-$latest-bin.tar.gz -C /usr/local/
\#create a sym link to it
    sudo ln -s /usr/local/apache-maven-$latest/bin/mvn /usr/bin/mvn

as outlined in the link above.

like image 34
TomRed Avatar answered Nov 22 '22 08:11

TomRed


I just installed maven 3.2.5. To do that I downloaded the version I wanted as noted.

Unzipped using: tar -xvf apache-maven-3.2.5-bin.tar.gz

to: /opt/ and let p7zip do its thing.

Then in the terminal I did the following:

  1. Check environment variable value: echo $JAVA_HOME

  2. Adding to PATH:

export PATH=/opt/apache-maven-3.2.5/bin:$PATH

  1. typed: mvn -v

reviewed the output

For me the above worked fine.

like image 31
DoesEatOats Avatar answered Nov 22 '22 08:11

DoesEatOats