最近在Jenkins中运行的Maven个构建作业(job)都失败了,下面的异常表示它们无法从Maven Central中提取依赖项,应该使用HTTPS.我不知道如何将请求从HTTP更改为HTTPS.有人能在这件事上指导我吗?

[ERROR] Unresolveable build extension:
Plugin org.apache.maven.wagon:wagon-ssh:2.1 or one of its dependencies could not be resolved:
Failed to collect dependencies for org.apache.maven.wagon:wagon-ssh:jar:2.1 ():
Failed to read artifact descriptor for org.apache.maven.wagon:wagon-ssh:jar:2.1:
Could not transfer artifact org.apache.maven.wagon:wagon-ssh:pom:2.1 from/to central (http://repo.maven.apache.org/maven2):
Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh/2.1/wagon-ssh-2.1.pom.
Return code is: 501, ReasonPhrase:HTTPS Required. -> [Help 2]

Waiting for Jenkins to finish collecting data[ERROR]
Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2):
Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom.
Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]

推荐答案

100中解释了观测到的误差的原因

自2020年1月15日起,中央存储库不再支持 不安全的纯HTTP通信,并要求所有请求 通过HTTPS加密到存储库.

看起来Maven的最新版本(在3.6.0和3.6.1中试用)已经默认使用HTTPS URL.

以下是主要存储库切换的日期:

100

更新:似乎从maven 3.2.3开始,maven Central是通过HTTPS访问的 见https://stackoverflow.com/a/25411658/5820670

Maven更改日志(log)

Java相关问答推荐

Informix PrepareStatement引发错误-将LIMIT Clause添加到查询时,字符到数字的转换过程失败

LocalTime解析截断时间的第二个值

将具有多个未知字段的SON映射到Java POJO

无法找到符号错误—Java—封装

使用java访问具体子类特定方法的最佳方法是什么?

缩小画布比例后更改滚动窗格的内部大小

扩展到弹出窗口宽度的JavaFX文本字段

所有 case 一起输入时输出错误,而单独放置时输出正确

CompleteableFuture是否运行在不同的内核上?

JPanel透支重叠的JComcoBox

如何将其他属性引用到log4j2 yaml配置中?

WebSockets和Spring Boot安全性出现错误401

如何集成语义发布和BitBucket(Java项目)

FETCH类型设置为LAZY,但它仍会发送第二个请求

Quarkus:运行时出现EnumConstantNotPresentException

JavaFX:无论何时显示应用程序,如何更改组件/ node 位置?

将BlockingQueue+守护程序线程替换为执行器

在Spring Boot中使用咖啡因进行缓存

如何在Spring Boot中为不同的部署环境管理多个.properties文件?

Spring Mapstruct如何获取Lazy初始化实体字段的信息?