maven 中心源地址更新爲 https 的問題

參考:https://www.jdon.com/53693

聲明:使用 maven 中心倉庫遇到的問題,如果是阿里源可能沒啥問題

剛纔 java 編譯打包 maven 工程時,一直報錯,看了下是 Maven dependencies are failing with a 501 error: user https://repo.maven.apache.org/maven2 ...

於是查了下資料,參照修改了下本地配置.估摸着大家也會有這個問題吧.方案如下(不一定是唯一的): 1.Add a repository in your project´s pom.xml file

<project> <repositories> <repository> <id>central maven repo</id> <name>central maven repo https</name> <url>https://repo.maven.apache.org/maven2</url> </repository> </repositories> </project>

2.Add the repository into a profile in the settings.xml file.

<profile> <id>my profile</id> <repositories> <repository> <id>central maven repo</id> <name>central maven repo https</name> <url>https://repo.maven.apache.org/maven2</url> </repository> </repositories> </profile> 3.Update you maven version to a new one that uses https values as default. The lastest one at this moment 3.6.3 Download here( https://maven.apache.org/download.cgi)

google 資料的地址爲 https://stackoverflow.com/questions/59763531/maven-dependencies-are-failing-with-a-501-error 大家也可以自行去看一下. 希望可以幫助到大家.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章