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


具體報錯信息如下:

  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位置

  

  在settings.xml中添加如下配置

  

  

    <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 即可。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM