mac maven配置

打开终端,打开配置文件
vim ~/.bash_profile
加入环境变量
# maven
export MAVEN_HOME=/usr/local/maven/apache-maven-3.8.6
export PATH=$PATH:$MAVEN_HOME/bin
#maven end
保存退出,打开 zsh 文件
vim ~/.zshrc
末尾加上下面这段
source ~/.bash_profile
关闭终端重新启动
mvn -v 

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /usr/local/maven/apache-maven-3.8.6
Java version: 1.8.0_333, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "13.0.1", arch: "x86_64", family: "mac"
环境变量配置成功

你可能感兴趣的:(mac maven配置)