spring boot

Mac IDEA配置maven

2019-11-26  本文已影响0人  Movle

1.下载

网址:http://maven.apache.org/download.cgi

下载maven

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> 
image.png
(2)idea配置
上一篇下一篇

猜你喜欢

热点阅读