maven问题汇总

本文介绍了如何处理Maven3.8.1后遇到的http仓库封锁问题,通过修改settings.xml中的镜像设置来解决。同时,解释了SpringBoot项目中不同依赖添加版本号的原因,涉及到父依赖和子依赖的版本管理策略。
摘要由CSDN通过智能技术生成


1、报错 failed to transfer from http://0.0.0.0/ during a previous attempt.

com.byd.xxx:xxx-parent:pom:1.1.0-SNAPSHOT failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact com.byd.xxx:xxx-parent:pom:1.1.0-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [xxxrepo (http://hub.byd.com:9081/repository/maven-xxx-snapshot/, default, releases+snapshots), xxx (http://hub.byd.com:9081/repository/maven-xxx-snapshot, default, releases+snapshots)]

Since Maven 3.8.1 http repositories are blocked.

新版本maven 不支持http问题,通过在settings.xml增加如下内容即可解决:

<mirror>
  <id>maven-default-http-blocker</id>
  <mirrorOf>external:http:*</mirrorOf>
  <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
  <url>http://0.0.0.0/</url>
</mirror>

其中url写成实际的地址:例如:http://hub.byd.com:9081/repository/maven-xxx-snapshot/

​2、为什么springboot的pom文件中有的依赖不用加版本号,有的依赖却必须加

应为springboot中引入了一个父依赖,其中包含了一些依赖的版本号,这些依赖不需要添加版本,而有一些依赖并不在父依赖的版本中,这些依赖需要添加版本。
在这里插入图片描述

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值