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

时间:2025-04-21 17:49:56

maven导入依赖包报错:
spring-boot-starter-actuator not found
:spring-boot-starter-actuator:jar:unknown was not found in /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网站上自己查:/

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

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