关于构建springboot2.x出现报错镜像找不到springboot包的问题

报错原因

今天第一次学习springboot出现了报错,在2023.10.31构建springboot时springboot2只能够选择2.7.17版本,在JDK选择了与之匹配的1.8以后仍旧出现报错org.springframework.boot:spring-boot-starter-parent:pom:2.7.17.RELEASE was not found in http://maven.aliyun.com/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced。

解决方法

最后通过将pom.xml文件中的2.7.17.RELEASE改为2.7.17后问题解决

同时注意maven的镜像配置文件settings.xml,如果配置有问题会导致超时,爆一堆奇奇怪怪的错误。

settings.xml文件如下:







  
  

  

  

  
  
    
  

  
  
    
  

  
  
    

    
  

  
  
    
    
    
      aliyun-public
      *
      aliyun public
      https://maven.aliyun.com/repository/public
    
    
      aliyun-central
      *
      aliyun central
      https://maven.aliyun.com/repository/central
    
    
      aliyun-spring
      *
      aliyun spring
      https://maven.aliyun.com/repository/spring
    
    
  

  
  
    

    
  

  

你可能感兴趣的:(spring,boot,后端,java)