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:Usersxxxx.m2 epository
修改为我们指定路径
<!--自定义本地仓库路径--> <localRepository>E:Apacheapache-maven-3.6.1conf epository</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:Apacheapache-maven-3.6.1confsettings.xml
Local repository 会被自动识别为 E:Apacheapache-maven-3.6.1conf epository
4.修改eclipse设置
菜单->Window->Preferences->Maven->Installations->
Add->Directory->指定E:Apacheapache-maven-3.6.1->Finish
选中刚刚指定的->Apple
菜单->Window->Preferences->Maven->User Settings->
Global Settings 和 User Settings都使用:E:Apacheapache-maven-3.6.1confsettings.xml
Local repository 会被自动识别为 E:Apacheapache-maven-3.6.1conf epository
最后Apple->ok