1.Run the wget command from the dir you want to extract maven too.

wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

2.run the following to extract the tar,

tar xvf apache-maven-3.3.9-bin.tar.gz

3.move maven to /usr/local/apache-maven

mv apache-maven-3.3.9  /usr/local/apache-maven

4.Next add the env variables to your ~/.bashrc file

export M2_HOME=/usr/local/apache-maven
export M2=$M2_HOME/bin 
export PATH=$M2:$PATH

5.Execute these commands

source ~/.bashrc

6.Verify everything is working with the following command      

mvn -version

 

 

 posted on 2015-11-30 15:42  xdsfoo  阅读(2808)  评论(0编辑  收藏  举报