配置方法1: 在 $MAVEN_HOME/conf 下的 settings.xml 的标签中添加如下配置:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
配置方法2: 在 pom.xml 中直接添加
<repositories><!-- 代码库 -->
<repository>
<id>maven-ali</id>
<url>http://maven.aliyun.com/nexus/content/groups/public//</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
本文介绍了两种配置阿里云Maven中央仓库的方法:一是在settings.xml文件中添加镜像配置;二是在pom.xml文件中直接添加仓库配置。这两种方法都能有效提升Maven项目的构建速度。
336

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



