若是springBoot项目的话:在pom.xml文件中添加以下配置
<!--使用阿里云maven中央仓库-->
<repositories>
<repository>
<id>aliyun-repos</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
若是其他maven项目,则在maven目录的setting.xml文件中的 <mirrors></mirrors>标签中添加代码:
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
本文介绍如何在SpringBoot项目及Maven项目中配置阿里云Maven中央仓库,以提高依赖下载速度。对于SpringBoot项目,在pom.xml中添加特定配置;对于其他Maven项目,在settings.xml中进行设置。
653

被折叠的 条评论
为什么被折叠?



