编辑
2023-03-12
实用工具
00
请注意,本文编写于 778 天前,最后修改于 191 天前,其中某些信息可能已经过时。

目录

配置地址:
修改jar包下载地址
修改为阿里云镜像
系统环境变量配置
idea切换

maven下载配置成国内镜像提高下载速度

配置地址:

文件路径:D:\maven\apache-maven-3.6.0\conf\settings.xml

修改jar包下载地址

xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository --> <localRepository>D:\maven\repository</localRepository>

image.png

修改为阿里云镜像

xml
<mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors>

image.png

系统环境变量配置

系统环境变量

新增属性名MAVEN_HOME 属性值D:\maven\apache-maven-3.6.0

Path 添加属性值%MAVEN_HOME%\bin

测试是否成功

cmd mvn -v

输出maven版本信息就是成功

idea切换

最后在idea配置的maven中切换到这个文件即可

本文作者:Weee

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!