linux-tutorial/docs/deploy/tool/maven/install-maven.md

36 lines
845 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Maven 安装
## 安装方法
安装步骤如下:
1下载
进入官网下载地址https://maven.apache.org/download.cgi ,选择合适的版本下载。
我选择的是最新 Maven3 版本http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
2解压到本地
我个人喜欢存放在:`/opt/software/maven`
3设置环境变量
输入 `vi /etc/profile` ,添加环境变量如下:
```
# MAVEN 的根路径
export MAVEN_HOME=/opt/software/maven/apache-maven-3.5.2
export PATH=\$MAVEN_HOME/bin:\$PATH
```
执行 `source /etc/profile` ,立即生效
4检验是否安装成功执行 `mvn -v` 命令
## 脚本
以上两种安装方式,我都写了脚本去执行:
| [安装脚本](https://github.com/dunwu/linux/tree/master/codes/deploy/tool/maven) |