1. 程式人生 > >Could not transfer artifact xxx from/to xxx 解決方案

Could not transfer artifact xxx from/to xxx 解決方案

Could not transfer artifact xxx from/to xxx解決方案

問題描述

本地倉庫有對應的jar包,但是maven install 一直提示 Could not transfer artifact。折騰了我老半天

Failed to read artifact descriptor for *: Could not transfer artifact * from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]

Failed to read artifact descriptor for *: Could not transfer artifact com.* from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]

解決步驟

  1. 找到本地倉庫對應的問題jar包 后里面一個 _remote.repositories 檔案; 在這裡插入圖片描述
  2. 開啟這個檔案 把 public= 改成 central=ps: nexus 表示為私服,central表示為中央倉庫 在這裡插入圖片描述
  3. 此時可以重新編譯,如果還是報 Could not transfer artifact ,不要方,你可以再嘗試把對應jar包目錄中 .lastUpdated結尾的檔案給幹掉,這個時候就好了。

希望這個解決方案可以幫助大家,謝謝