Mac 使用 idea 自带的maven

85 阅读1分钟

1. maven 目录

/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3

2. 添加到环境变量

# 添加以下代码到 ~/.bash_profile
export M2_HOME="/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3"
export PATH="$M2_HOME/bin:$PATH"

# 添加以下代码到 ~/.zshrc
source ~/.bash_profile


# 最后执行如下命令
source ~/.zshrc

3. 验证

mvn --version