打开安装的 maven 的 setting.xml
修改仓库位置 - localRepository 标签 (改成自己想改的位置)
在 mirrors 标签添加
<mirror> | |
<id>alimaven</id> | |
<mirrorOf>central</mirrorOf> | |
<name>aliyun maven</name> | |
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url> | |
</mirror> | |
<mirror> | |
<id>repo1</id> | |
<mirrorOf>central</mirrorOf> | |
<name>central repo</name> | |
<url>http://repo1.maven.org/maven2/</url> | |
</mirror> | |
<mirror> | |
<id>aliyunmaven</id> | |
<mirrorOf>apache snapshots</mirrorOf> | |
<name>阿里云阿帕奇仓库</name> | |
<url>https://maven.aliyun.com/repository/apache-snapshots</url> | |
</mirror> |
- 在 profiles 标签添加
<profile> | |
<repositories> | |
<repository> | |
<id>aliyunmaven</id> | |
<name>aliyunmaven</name> | |
<url>https://maven.aliyun.com/repository/public</url> | |
<layout>default</layout> | |
<releases> | |
<enabled>true</enabled> | |
</releases> | |
<snapshots> | |
<enabled>true</enabled> | |
</snapshots> | |
</repository> | |
<repository> | |
<id>MavenCentral</id> | |
<url>http://repo1.maven.org/maven2/</url> | |
</repository> | |
<repository> | |
<id>aliyunmavenApache</id> | |
<url>https://maven.aliyun.com/repository/apache-snapshots</url> | |
</repository> | |
</repositories> | |
</profile> |