pom.xml中报错Failure to transfer com.thoughtworks.xstream:xstream-parent:pom:1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository

时间:2023-01-25 23:28:04

具体报错信息如下:

  Failure to transfer com.thoughtworks.xstream:xstream-parent:pom:1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.thoughtworks.xstream:xstream-parent:pom:1.3.1 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.

 

 这里没有弄清楚具体原因是什么,在Maven的配置文件settings.xml中,配置了镜像后问题得以解决,配置方式如下:

  在Eclipse中正确配置Maven信息,在其中找到User Settings中配置的settings.xml位置

  pom.xml中报错Failure to transfer com.thoughtworks.xstream:xstream-parent:pom:1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository

  在settings.xml中添加如下配置

  pom.xml中报错Failure to transfer com.thoughtworks.xstream:xstream-parent:pom:1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository

  

    <mirror>
      <id>alimaven</id> 
      <name>aliyun maven</name> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url> 
      <mirrorOf>central</mirrorOf>  
    </mirror> 

    然后在Eclipse中右击项目——>Maven——>Update Project 即可。