maven报错:Return code is: 501 , ReasonPhrase:HTTPS Required

时间:2023-01-03 07:46:17

今天把一个去年没做完的项目翻出来做时,发现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>

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

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

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&colon; 400&comma; ReasonPhrase&colon; Bad Request&period;

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

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

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

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

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

  4. mvn deploy 报错:Return code is&colon; 400&comma; ReasonPhrase&colon; Bad Request&period; ->

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

  5. 解决Maven 报 Return code is&colon; 400 &comma; ReasonPhrase&colon;Repository version policy&colon; SNAPSHOT does not allow version&colon; 2&period;1&period;0&period;RELEASE&period; 的错误

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

  6. 【Maven错误】 Non-resolvable parent POM for &period;&period;&period;&period;&period;&period; Return code is&colon; 500 &comma; ReasonPhrase&colon;Internal Server Error&period; and &&num;39&semi;parent&period;relativePath&&num;39&semi; points at no local POM &commat; line 14&comma; column 11

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

  7. QA&colon;Failed to deploy artifacts from&sol;to snapshots XX Failed to transfer file Return code is&colon; 405&comma; ReasonPhrase&colon;Method Not Allowed&period;

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

  8. pip安装软件报错 utf-8 code can&&num;39&semi;t decode byte 0xcf in position7

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

  9. maven报错非法字符:&bsol;65279 错误

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

随机推荐

  1. html&sol;css 布局练习3

    效果图:

  2. &lbrack;BS-15&rsqb; Values of type &&num;39&semi;NSInteger&&num;39&semi; should not be used as format arguments

    Values of type 'NSInteger' should not be used as format arguments 苹果app支持arm64以后会有一个问题:NSInteger变成64 ...

  3. Http权威指南笔记&lpar;一&rpar; URI URL URN 关系

    定义 URI:统一资源标识符(Uniform Resource Indentifier)用来标识服务器上的资源. URL:统一资源定位符(Uniform Resouce Locator)是资源标识符最 ...

  4. JQuery控制下拉列表

    //遍历option和添加.移除option function changeShipMethod(shipping){ var len = $("select[@name=ISHIPTYPE ...

  5. java List递归排序,传统方式和java8 Stream优化递归,无序的列表按照父级关系进行排序(两种排序类型)

    当有一个List列表是无序的,List中的数据有parentid进行关联,通过java排序成两种排序类型: 所用的测试列表最*无parentid,若为特殊值,修改下判断方法即可. 第一种排序:按照树 ...

  6. itoa&lpar;&rpar;函数和atoi&lpar;&rpar;函数详解

    C语言提供了几个标准库函数,可以将任意类型(整型.长整型.浮点型等)的数字转换为字符串. 以下是用itoa()函数将整数转换为字符串的一个例子:# include <stdio.h># i ...

  7. ng 的 ng-repeat(对象) 把对象的 key 和value 都拿出来 循环

    对象的repeat  是这种形式

  8. 安装mysql时包冲突解决方法

    报错信息如下: 解决办法: 在卸载代码上加上不检查关联信息即可(rpm -ev mysql-libs-5.1.73-7.el6.x86_64 --nodeps) 检查服务器是否还有mysql安装包:r ...

  9. 【bzm-Random CSV Data Set Config】 -jmeter - 文件中随机取参的方法,(插件自带)

    文件中随机取参数的方法  Random CSV Data Set Config

  10. &lbrack;转&rsqb;iOS系列译文:深入理解 CocoaPods

    Cocoapods是 OS X 和 iOS 下的一个第三方库管理工具.你能使用CocoaPods添加被称作“Pods”的依赖库,并轻松管理它们的版本,而不用考虑当前的时间和开发环境. Cocoapod ...