【SpringBoot踩坑笔记】maven导入spring-boot-starter依赖包报错

当导入spring-boot-starter-actuator依赖时遇到找不到的问题,可以通过在依赖中添加具体版本号(如2.7.5)来解决。此问题通常是由于中央仓库未找到该依赖导致的,添加版本号后可以从Maven仓库成功获取。

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

maven导入依赖包报错:
spring-boot-starter-actuator not found
org.springframework.boot:spring-boot-starter-actuator:jar:unknown was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

搜了好久也没找到解决方案,于是,求人不如求己,自己开始研究,🧐
只需在依赖后面加上版本号即可(比如2.7.5),版本号可以在maven网站上自己查:https://mvnrepository.com/

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
      <version>2.7.5</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-aop</artifactId>
        <version>3.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
        <version>3.0.7</version>
      <scope>test</scope>
    </dependency>

加上版本号之后,依赖就可以正确导入了!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值