欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

關(guān)于maven打包時的報錯: Return code is: 501 , ReasonPhrase:HTTPS Required

 更新時間:2020年09月07日 10:17:36   作者:風(fēng)一樣的小李子  
這篇文章主要介紹了關(guān)于maven打包時的報錯: Return code is: 501 , ReasonPhrase:HTTPS Required,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

今天使用jenkins構(gòu)建時,報以下錯誤

  [ERROR] Failed to execute goal on project saas20: Could not resolve dependencies for project com.ipower365.saas:saas20:war:0.0.1-SNAPSHOT: Failed to collect dependencies at com.ipower365.saas:messageserviceimpl:jar:0.0.1-SNAPSHOT -> com.ipower365.boss:nacha:jar:1.0.1: Failed to read artifact descriptor for com.ipower365.boss:nacha:jar:1.0.1: Could not transfer artifact com.ipower365.boss:nacha:pom:1.0.1 from/to central (http://repo1.maven.org/maven2/):

Failed to transfer file:

http://repo1.maven.org/maven2/com/ipower365/boss/nacha/1.0.1/nacha-1.0.1.pom

. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]

  我們發(fā)現(xiàn),這個依賴的文件在本地倉庫是有的,但是在構(gòu)建過程中,在本地nexus下載完文件后,還是會像中央倉庫請求文件下載

    [echoing saas20] Downloading from central: http://repo1.maven.org/maven2/com/ipower365/boss/nacha/1.0.1/nacha-1.0.1.pom

  之后我們根據(jù)返回的501錯誤,去搜索問題,參考鏈接如下:

  https://stackoverflow.com/questions/59763531/maven-dependencies-are-failing-with-501-error

  上面提示,自2020年1月15日起,中央存儲庫不再支持通過純HTTP進(jìn)行的不安全通信,并且要求對存儲庫的所有請求都通過HTTPS進(jìn)行加密。

  于是我們在構(gòu)建過程中所依賴的settings文件中,加入了一以下配置:

<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>

  但是問題依然沒有解決,接著報錯,錯誤如下:

    Could not transfer artifact com.ipower365.boss:nacha:pom:1.0.1 from/to central

 (https://repo1.maven.org/maven2/):

Received fatal alert: protocol_version -> [Help 1]

  這個是在使用https協(xié)議請求中央倉庫時,需要指定協(xié)議版本,然后在構(gòu)建時,加入了如下參數(shù),參考鏈接如下: 

    https://stackoverflow.com/questions/50824789/why-am-i-getting-received-fatal-alert-protocol-version-or-peer-not-authentic  

然后再次構(gòu)建時,就通過請求了!

原因:我們Java環(huán)境用的是7和8兩種,而我們的mvn版本用的是3.5.x。

所以,在JAVA8環(huán)境使用mvn打包時,不需要指定以上參數(shù),但是使用JAVA7環(huán)境的時候,則會出現(xiàn)以上報錯。后面會考慮更新下mvn的版本及統(tǒng)一JAVA環(huán)境

到此這篇關(guān)于關(guān)于maven打包時的報錯: Return code is: 501 , ReasonPhrase:HTTPS Required的文章就介紹到這了,更多相關(guān)maven打包報錯內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論