**
* 描述:Linux安装maven
* 参考资料:
* @author songfayuan
* 2017年09月09日14:56:00
*/
1. 上maven官网http://maven.apache.org/download.cgi下载apache-maven-3.5.0-bin.tar.gz
2. 通过工具上传至Linux服务器的home文件夹
3. 解压:tar -zxvf apache-maven-3.5.0-bin.tar.gz
4. 移动并重命名:mv apache-maven-3.5.0 /opt/maven-3.5.0
5. 配置环境变量,在/etc/profile加入配置信息(前提是你已经配置好了jdk)
export MAVEN_HOME=/opt/maven-3.5.0
export PATH=${PATH}:${MAVEN_HOME}/bin
export PATH=${PATH}:${MAVEN_HOME}/bin
6. 加载配置:source /etc/profile
7. 运行mvn -v查看maven是否安装成功,如果配置成功,则打印如下信息
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /opt/maven-3.5.0
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_91/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux“, version: “3.10.0-514.6.2.el7.x86_64”, arch: “amd64”, family: “unix”
Maven home: /opt/maven-3.5.0
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_91/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux“, version: “3.10.0-514.6.2.el7.x86_64”, arch: “amd64”, family: “unix”
本帖作者:宋发元 转自:https://blog.csdn.net/u011019141/article/details/77915312