0%

安裝Maven

安裝Maven

先下載maven:

1
$ wget https://www-us.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz

解開包:

1
$ tar xzvf apache-maven-3.6.0-bin.tar.gz

移動到/opt/底下:

1
$ mv apache-maven-3.6.0-bin /opt

設置Maven環境變數

打開/etc/profile這個檔案並且在末尾加入:

1
2
3
4
5
export MAVEN_HOME=/opt/apache-maven-3.6.0
export M2_HOME=/opt/apache-maven-3.6.0

export PATH=$PATH:$MAVEN_HOME/bin
export PATH=$PATH:$M2_HOME/bin