maven 中心源地址更新为 https 的问题

2020-01-19 16:09:05 +08:00
 liangzai

声明:使用 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 大家也可以自行去看一下. 希望可以帮助到大家.

3166 次点击
所在节点    程序员
1 条回复
shuangyeying
2020-04-15 19:57:21 +08:00
感谢,之前配置还好好的,用到一个本地仓库没有的 jar 包,才发现这个问题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/639199

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX