Must already have a jdk installed. In my case: java-7-oracle.
Open a terminal and execute the commands below.
- wget http://apache.petsads.us/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
- tar -zxf apache-maven-3.0.4-bin.tar.gz
- sudo cp -R apache-maven-3.0.4 /usr/local
- open the ~/.profile and add the following lines:
- M2_HOME="/usr/local/apache-maven-3.0.4"
- M2="$M2_HOME/bin"
- PATH="$M2:$PATH"
- Save the file and re-log to load the new environment variables.
- Make sure that java is in your path. This should have been done while setting up a jdk.
- mvn –version to verify maven.
I've recently found that depending upon your ubuntu flavor, that the .profile file may not be used. Instead the .bashrc file may get loaded. I've seen this in Lubuntu (LXDE) and Bodhi (Enlightenment). The process is the same, just add the files to the ~/.bashrc instead.
Download Mirrors:http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
Sources:
http://java.dzone.com/articles/installing-maven-304-ubuntu
https://help.ubuntu.com/community/EnvironmentVariables
http://maven.apache.org/download.htmlhttp://maven.apache.org/download.html
1 comment:
Nice and neat. Thanks! Current version as of now is 3.1.0
Post a Comment