linux下maven3.3.9安装

安装maven3.3.9

1.在/usr/local文件中创建

mkdir /usr/local/maven

2.下载maven文件到创建的文件中

cd /usr/local/maven
wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

3.解压 apache-maven-3.3.9-bin.tar.gz 文件

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

4.设置maven的环境变量

vi /etc/profile

5.在profile的文件末尾加上以下配置

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

6.执行source命令让新配置的profile生效

source /etc/profile

7.测试maven是否安装成功

mvn -vApache Maven 3.3.9

输出:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/maven
Java version: 1.8.0_192, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_192-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “3.10.0-862.14.4.el7.x86_64”, arch: “amd64”, family: “unix”
You have new mail in /var/spool/mail/root

安装成功!!!

你可能感兴趣的:(maven)