Installing Maven on Ubuntu 10.10
Get Maven. Can download from any of the mirrors in this url.
From download directory unzip the downloaded maven distribution(e.g apache-maven-3.0.x.tar.gz) with the below command:
tar zxvf apache-maven-3.0.x.tar.gz
A directory called “apache-maven-3.0.x” will be created.
Copy the unziped folder and paste it in usr/local/src. Copy and paste can be done with the below command:
sudo cp -R apache-maven-3.0.3/ $home/usr/local/src
Configure Maven installation in linux environment variable list.
Environment variable disappears as soon as it has been set in the terminal. In order to keep it available in the ubuntu system it has to be included in the .bashrc file which is in the /home directory.
Open the bashrc file with the following command:
This will open the bashrc file in the gedit editor as below.
Go to the bottom of the file and add the below text in the editor:
export M2_HOME=/usr/local/src/apache-maven-3.0.3 export M2=$M2_HOME/bin export PATH=$M2:$PATH
Test the configuration by execution the below command in a new terminal:
The result of the above would be as below sample:
The installation is complete.