Failure to find org.springframework.cloud:spring-cloud-dependencies:pom:Greenwich.M1

本文详细解析了Maven编译时遇到的依赖包获取失败问题,提供了修改pom.xml文件中仓库配置的具体方法,帮助开发者有效解决依赖问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误信息:

[ERROR]     Non-resolvable import POM: Failure to find org.springframework.cloud:spring-cloud-dependencies:pom:Greenwich.M1 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced @ line 59, column 16 -> [Help 2]

错误原因:

编译时无法从maven的setting.xml中配置的仓库中获取工程所依赖的包

解决办法:

在pom.xml中指定仓库

<repositories>
    <repository>
         <id>spring-milestones</id>
         <name>Spring Milestones</name>
         <url>https://repo.spring.io/milestone</url>
         <snapshots>
             <enabled>false</enabled>
         </snapshots>
    </repository>
</repositories>

 

说明:

<repositories>的配置:

1. 可以在它下面添加多个<repository> ,每个<repository>都有它唯一的ID,一个描述性的name,以及远程仓库的url。

2. <releases><enabled>true</enabled></releases>告诉Maven可以从这个仓库下载releases版本的构件。

3. <snapshots><enabled>false</enabled></snapshots>告诉Maven不要从这个仓库下载snapshot版本的构件。

maven中的仓库分为两种,snapshot快照仓库和release公布仓库。snapshot快照仓库用于保存开发过程中的不稳定版本号,release正式仓库则是用来保存稳定的发行版本号。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值