1.安装brew
如果报错,Warning: /opt/homebrew/bin is not in your PATH.
vim ~/.zshrc,最后一行追加
export PATH="/opt/homebrew/bin:$PATH"
source ~/.zshrc
2.安装brew install maven
mvn -version查看路径
Maven home: /opt/homebrew/Cellar/maven/3.9.9/libexec
修改配置vi /opt/homebrew/Cellar/maven/3.9.9/libexec/conf/settings.xml
bash
<localRepository>/Users/aaron/m2_repo</localRepository>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
<mirror>
<id>ali-mirror</id>
<mirrorOf>central</mirrorOf>
<name>taobao mirror</name>
<url>http://mvnrepo..com/mvn/repository</url>
</mirror>
idea配置
如果mvn package
涉及repo库冲突,最简单的办法,就是把库删除掉。