配置方法1: 在 $MAVEN_HOME/conf 下的 settings.xml 的<mirrors>标签中添加如下配置:
- <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项目的构建效率。
1497

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



