# Maven:Could not transfer artifact org.springframework:spring-webmvc:pom:。。。(系统找不到文件),从网上clone到本地的项目报红

解决办法:

  1. 确保maven配置正确,在maven的setting.xml配置文件中,

    1. 配置本地仓库路径

      <localRepository>D:\Maven\文件名</localRepository>
      
    2. 添加镜像仓库的配置,在mirrors节点下面添加子节点:

      <mirror>
          <id>aliyun</id>
          <mirrorOf>central</mirrorOf>
          <name>aliyun</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public</url>
      </mirror>
      
  2. 在idea中,打开File-->Settings-->Build,Exception,Deployment-->Build Tools-->Maven

找到里面的:

​ 这里的User setting file: 和 Local repository:显示的都是网上别人的配置文件和仓库路径,需要手动改为自己本地maven的setting.xml文件和本地仓库路径,完美解决。

posted @ 2020-10-21 18:56  little_lunatic  阅读(897)  评论(0)    收藏  举报