1. 程式人生 > >Maven報錯#Could not transfer artifact (https:repo.maven.apache.org/maven2):Received fatal alert:procol

Maven報錯#Could not transfer artifact (https:repo.maven.apache.org/maven2):Received fatal alert:procol

Maven構建專案報錯:Could not transfer artifact https:repo.maven.apache.org/maven2:Received fatal alert:protocol_version->[Help 1]

RT
最初以為是本地網路狀態不好,在確認網路良好的情況下構建專案,多次maven-install後,依然報這個錯。只能求助度娘,試了幾種方法都用不了,最好才找到原因:中央倉庫必須要TLS1.2版本才能訪問,有兩種解決方法:

一、將JDK版本升級到jdk1.8,因為在1.8及以上版本,才會預設使用TLS1.2。

二、maven的配置檔案setting.xml中設定為阿里雲私服,設定方式可在度娘裡查。