今天把一个去年没做完的项目翻出来做时,发现maven无法正常导入依赖。检查了一遍项目配置,没发现有什么问题。而且依赖在本地仓库存在。

随后发现报错:Failed to transfer file:*********. Return code is: 501 , ReasonPhrase:HTTPS Required. 这时候好像发现了什么重点————我们需要将maven配置修改一下:

        <!-- 中央仓库1 -->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror> <!-- 中央仓库2 -->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>https://repo2.maven.org/maven2/</url>
</mirror>

随后发现可以正常导入依赖了。

在stackoverflow上查了下,发现有人也遇到了这个问题:

Recently Maven build jobs running in Jenkins are failing with the below exception saying that they could not pull dependencies from Maven Central and should use HTTPS. I am not sure how to change the requests from HTTP to HTTPS. Could someone guide me on this matter?

回答如下:

Effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS.

所以这个问题的根源就是maven中央仓库现在只支持HTTPS协议,我们改一下就行。

maven报错:Return code is: 501 , ReasonPhrase:HTTPS Required的更多相关文章

  1. maven deploy Return code is: 400, ReasonPhrase: Bad Request.

    最近在自己本地deploy jar 到本地 nexus的时候,报错 Return code is: 400, ReasonPhrase: Bad Request. 解决思路: 1.查看maven pr ...

  2. Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案

    我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...

  3. Maven私有仓库: 发布release版本报错:Return code is: 400, ReasonPhrase: Repository does not allow upd ating assets: maven-releases.

    今天在将一个maven组件由SNAPSHORT升级为正式版本1.0.0,然后执行发布: mvn clean deploy -pl ielong-common -am -DskipTests, 报错:R ...

  4. mvn deploy 报错:Return code is: 400, ReasonPhrase: Bad Request. ->

    mvn deploy 报错:Return code is: 400, ReasonPhrase: Bad Request. -> TEST通过没有报错,但是最终部署到Nexus中时出现错误. 后 ...

  5. 解决Maven 报 Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE. 的错误

    最近在搭建公司的基础框架,业务需求用到elasticsearch,所以需要整合到基础框架里,供各业务线使用同时也便于管理,但在整合的过程中,出现了莫名的问题,同时maven的提示也不够明确. 我的版本 ...

  6. 【Maven错误】 Non-resolvable parent POM for ...... Return code is: 500 , ReasonPhrase:Internal Server Error. and 'parent.relativePath' points at no local POM @ line 14, column 11

    一.异常信息 [INFO] Scanning for projects... Downloading: http://www.myhost.com/maven/jdk18/org/springfram ...

  7. QA:Failed to deploy artifacts from/to snapshots XX Failed to transfer file Return code is: 405, ReasonPhrase:Method Not Allowed.

    QA: Failed to deploy artifacts from/to snapshots XX Failed to transfer file Return code is: 405, Rea ...

  8. pip安装软件报错 utf-8 code can't decode byte 0xcf in position7

    pip安装软件报错 utf-8 code can't decode byte 0xcf in position7 根据错误提示的路径找到__init__.py文件 根据错误提示的最后几句话找到对应的行 ...

  9. maven报错非法字符:\65279 错误

    开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...

随机推荐

  1. C# 如何写出一个不能被其他程序集继承的抽象类

    我需要限定某个抽象类只能在我程序集类实现,而不支持其他程序集实现,也就是我需要一个不能被继承的抽象类 在 C# 里面有抽象类和接口,这两个都是期望被继承才能被使用,而抽象类是可以做到只能在自己程序集和 ...

  2. HDU - 4289 Control (Dinic)

    You, the head of Department of Security, recently received a top-secret information that a group of ...

  3. kube-batch 解析

    kube-batch https://github.com/kubernetes-sigs/kube-batch 一. 做什么的? 官方介绍: A batch scheduler of kuberne ...

  4. Realm 配置

    快速入门 本文档介绍了如何借助一个“数据库”来配置 Tomcat ,从而实现容器管理安全性.所要连接的这种数据库含有用户名.密码以及用户角色.你只需知道的是,如果使用的 Web 应用含有一个或多个 & ...

  5. 第二阶段:流程图:8.axure绘制简单业务流程图

    元件库选择流程图 流程图示例 一个简单的注册练习 线上可以写字 作业

  6. deep Q learning小笔记

    1.loss 是什么 2. Q-Table的更新问题变成一个函数拟合问题,相近的状态得到相近的输出动作.如下式,通过更新参数 θθ 使Q函数逼近最优Q值 深度神经网络可以自动提取复杂特征,因此,面对高 ...

  7. 【他山之石】mysql编码问题总结

    有些问题可能比较基础,但是没有经过系统学习还是可能会出错,记录下. 这次是mysql的编码问题. 背景是部署新的测试环境,给了一台服务器还有在另一个环境下的mysql,配置过程中发现mysql编码有问 ...

  8. 【题解】[HAOI2018]染色(NTT+容斥/二项式反演)

    [题解][HAOI2018]染色(NTT+容斥/二项式反演) 可以直接写出式子: \[ f(x)={m \choose x}n!{(\dfrac 1 {(Sx)!})}^x(m-x)^{n-Sx}\d ...

  9. Windows服务器管理--批量管理工具

    iis7批量远程控制: 一款电脑远程监控的工具,IIS7远程桌面管理是一款专业的远程桌面连接软件,无需安装.操作简单方便.完美的界面设计.强大的监控功能.稳定的系统平台,满足了用户实现远程桌面连接的需 ...

  10. Theia架构

    上一篇:Theia——云端和桌面版的IDE 架构概述 本节描述了Theia的整体架构. Theia被设计为一个可以在本地运行的桌面应用程序,也可以在浏览器和远程服务器之间工作.为了支持这两种工作方式, ...