为idea配置全局maven加速镜像、单个项目maven(阿里)加速镜像

一、配置全局加速镜像

在maven的文件夹中找到settings.xml:apache-maven-3.6.3 -> conf -> settings.xml

image-20210817114640782

image-20210817114550506

image-20210817115003041

在settings.xml文件中的中添加

保存设置即可。

二、单个项目配置阿里加速镜像

打开项目,进入pom.xml文件

image-20210817115447445

添加代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
<repositories>
<repository>
<id>nexus</id>
<name>Nexus Repository</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

image-20210817115707013

pom.xml学习链接:(7条消息) 史上最全的 pom.xml 文件详解_雨雾清影的个人博客-CSDN博客_pom.xml

Contents
  1. 1. 一、配置全局加速镜像
  2. 2. 二、单个项目配置阿里加速镜像
|