linux maven安装配置

时间:2021-10-22 21:16:08

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