Maven使用经验

1.修改下载镜像

打开你的maven目录conf文件夹下配置文件settings.xml

ctrl + f 搜索“<mirrors>”,

让它只包含

<!-- 配置阿里云镜像 -->
<mirror>
<id>alimaven</id>
  <mirrorOf>central</mirrorOf>
  <name>aliyun maven</name>
  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>

 

2.修改本地仓库地址

ctrl + f 搜索“<localRepository>”,仓库的位置是${user.home}/.m2/repository。

默认在C:\Users\xxxx\.m2\repository

修改为我们指定路径

<!--自定义本地仓库路径-->
<localRepository>E:\Apache\apache-maven-3.6.1\conf\repository</localRepository>

 

3.修改idea设置

File->Settings->Build, Execute, Deployment->Build Tools->Maven

修改为:

修改 Maven home directory: E:/Apache/apache-maven-3.6.1
修改 User settings file: E:\Apache\apache-maven-3.6.1\conf\settings.xml
Local repository 会被自动识别为 E:\Apache\apache-maven-3.6.1\conf\repository

 

4.修改eclipse设置

菜单->Window->Preferences->Maven->Installations->
Add->Directory->指定E:\Apache\apache-maven-3.6.1->Finish
选中刚刚指定的->Apple

 

菜单->Window->Preferences->Maven->User Settings->
Global Settings 和 User Settings都使用:E:\Apache\apache-maven-3.6.1\conf\settings.xml
Local repository 会被自动识别为 E:\Apache\apache-maven-3.6.1\conf\repository
最后Apple->ok

 

posted @ 2020-04-19 00:10  杵臼  阅读(127)  评论(0编辑  收藏  举报