Installing Maven on Linux

Programmer light 2022-02-13 07:58:54 阅读数:368

installing maven linux

1、 download maven

Maven – Download Apache Mavenicon-default.png?t=L9C2


  Two 、 Upload to linux The server

  decompression :tar -zxvf apache-maven-3.8.3-bin.tar.gz

  3、 ... and 、 Configuration environment

mv apache-maven-3.8.3-bin /root/maven

vi /etc/profile

Finally add

export MAVEN_HOME=/root/maven
export PATH=$MAVEN_HOME/bin:$PATH 

Four 、 Refresh environment variable  

source /etc/profile

5、 ... and 、 Check version maven

mvn -v


6、 ... and 、 Configure Ali warehouse , Faster compilation

cd /root/maven/conf

vi settings.xml

Find the label mirror, Annotate the original image , Change to Alibaba cloud image . Note that the indentation

      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <name>aliyun maven</name>

perform mvn clean install, success


copyright:author[Programmer light],Please bring the original link to reprint, thank you.