Mac IDEA配置Maven
程序员文章站
2022-07-13 13:29:39
...
1.下载
网址:http://maven.apache.org/download.cgi
2.解压到此文件夹
/Users/macbook/Documents/maven/apache-maven-3.6.2
3.配置环境变量:
(1)编辑.bash_profile文件
vim ~/.bash_profile
(2)添加如下内容:
export M2_HOME=/Users/macbook/Documents/maven/apache-maven-3.6.2
export PATH=$PATH:$M2_HOME/bin
(3)使环境变量生效:
source ~/.bash_profile
(4)验证:
mvn -v
4.idea相关配置:
(1)配置Maven的setting.xml文件
vi /Users/macbook/Documents/maven/apache-maven-3.6.2/conf/settings.xml
修改内容为:
(a)本地仓库位置:
<localRepository>/Users/macbook/Documents/maven/apache-maven-3.6.2/repository </localRepository>
(b)国内镜像
<mirrors>
<mirror>
<id>ali maven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
(2)idea配置
上一篇: xposed第一个demo
下一篇: maven配置阿里云镜像