Maven配置指定阿里云(Aliyun)仓库以及下载jar包失败

àì夳堔傛蜴生んèń 2023-07-04 08:49 83阅读 0赞

Maven配置指定阿里云(Aliyun)仓库

Maven 仓库默认在国外, 国内使用难免很慢,我们可以更换为阿里云的仓库。

第一步:修改 maven 根目录下的 conf 文件夹中的 setting.xml 文件,在 mirrors 节点上,添加内容如下:

  1. <mirrors>
  2. <mirror>
  3. <id>alimaven</id>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  6. <mirrorOf>central</mirrorOf>
  7. </mirror>
  8. </mirrors>

在这里插入图片描述
第二步: pom.xml文件里添加:

  1. <repositories>
  2. <repository>
  3. <id>alimaven</id>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  6. <releases>
  7. <enabled>true</enabled>
  8. </releases>
  9. <snapshots>
  10. <enabled>false</enabled>
  11. </snapshots>
  12. </repository>
  13. </repositories>

如果启动项目时遇到jar包出现问题,很有可能是自动下载时没有下载完全

此时可以找出有问题的jar包,自己去中央仓库中下载对应版本,放到指定位置
中央仓库网址如下:
https://mvnrepository.com/

发表评论

表情:
评论列表 (有 0 条评论,83人围观)

还没有评论,来说两句吧...

相关阅读