Mac Homebrew安装Maven记录
1. brew search maven # 搜索maven安装的版本
2. brew install maven@3.5
3.
# 注意安装过程中出现以下输出...If you need to have maven@3.5 first in your PATH run:
echo 'export PATH="/usr/local/opt/maven@3.5/bin:$PATH"' >> ~/.zshrc
4.
vim ~/.bash_profile
# 加入内容
export PATH=/usr/local/opt/maven@3.5/bin:$PATH
# 使配置文件生效
source ~/.bash_profile
# 在zshrc中设置环境变量
vim ~/.zshrc
# 加入内容
export PATH=/usr/local/opt/maven@3.5/bin:$PATH
# 使配置文件生效
source ~/.zshrc
# 测试maven
mvn -v