链接:https://pan.baidu.com/s/1uWkrT2hwleYur1Vc-bAgAw
提取码:q4kd
官网下载:https://archive.apache.org/dist/maven/maven-3/
1:使用xftp上传maven的Linux压缩包到/usr/local/mysoft目录下
2:cd/usr/local/mysoft 进入mysoft目录,ls查看我们上传的压缩包
[root@myLinux mysoft]# ls
apache-maven-3.5.4-bin.tar.gz apache-tomcat-7.0.93 jdk1.8.0_251 nginx-1.12.0 redis-5.0.7 zookeeper-3.4.14
3:tar -zxvf apache-maven-3.5.4-bin.tar.gz 解压
[root@myLinux mysoft]# tar -zxvf apache-maven-3.5.4-bin.tar.gz apache-maven-3.5.4/README.txt apache-maven-3.5.4/LICENSE apache-maven-3.5.4/NOTICE
4:解压后ls,发现mysoft目录下多了一个apache-maven-3.5.4目录
[root@myLinux mysoft]# ls
apache-maven-3.5.4 apache-maven-3.5.4-bin.tar.gz apache-tomcat-7.0.93 jdk1.8.0_251 nginx-1.12.0 redis-5.0.7 zookeeper-3.4.14
5:vim /etc/profile 配置MAVEN_HOME并将其添加到path中
#配置maven export MAVEN_HOME=/usr/local/mysoft/apache-maven-3.5.4/bin export PATH=$PATH:${JAVA_PATH}:${MAVEN_HOME}
6:source /etc/profile 使配置文件生效
7:在任意目录执行mvn -v命令。若出现maven及java版本号,则说明maven环境配置成功
[root@myLinux mysoft]# mvn -v Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00) Maven home: /usr/local/mysoft/apache-maven-3.5.4 Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: /usr/local/mysoft/jdk1.8.0_251/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-514.26.2.el7.x86_64", arch: "i386", family: "unix"