一、修改maven的setting.xml

1、添加maven仓库位置

编辑setting.xml,添加如下配置: <localRepository>/software/maven/repository</localRepository> 中间的为maven依赖存储的位置,在使用IDEA创建项目时会使用。 注意:如果在Linux系统中,这个文件夹是手动创建的,一定要执行赋权语句: chmod +777 repository 否则,创建项目时,无法下载依赖到文件夹中。

2、添加阿里镜像源

在setting.xml中找到<mirros> </mirros>的位置,添加阿里源:

  1. <mirror>
  2. <id>alimaven</id>
  3. <name>aliyun maven</name>
  4. <url>https://maven.aliyun.com/repository/central</url>
  5. <mirrorOf>central</mirrorOf>
  6. </mirror>

image.png