Maven Build Failure | ReasonPhrase:HTTPS Required.

新手上路,请多包涵

Does anyone know what result in this Java Project build failure and how to resolve it? Thanks!
有没有人知道这个Java项目的搭建失败是怎么造成的吗,要怎么解决呢? 多谢!

Detailed Logs

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.720s
[INFO] Finished at: Sat May 16 16:34:49 CST 2020
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central (http://repo.maven.apache.org/...: Failed to transfer file: http://repo.maven.apache.org/... Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
[ERROR]
阅读 2.1k
2 个回答
✓ 已被采纳新手上路,请多包涵

The problem is resolved. As is shown in the log, the Maven plugin has been successfully downloaded.
这个问题被解决了。如日志所示,这个Maven插件已经被成功的下载下来了。

[INFO] Maven Compiler Plugin 3.1
The Compiler Plugin is used to compile the sources of your project.

This plugin has 3 goals:

compiler:compile
Compiles application sources

compiler:help
Display help information on maven-compiler-plugin.
Call mvn compiler:help -Ddetail=true -Dgoal=<goal-name> to display parameter
details.

compiler:testCompile
Compiles application test sources.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

How is the problem resolved? 这个问题怎么解决的呢?
The problem is resolved after an upgrade of Maven through upgrade of the integrated development environment, a subsitute of Maven repository, and a subsititue of Maven settings file.

  1. 我把整个集成开发环境的版本升级了随之Maven的版本也升级了。
  2. 我把Maven的仓库替换了。
  3. 我把Maven的配置文件替换了。

The new Maven version is 3.6.3.
The Maven 3 repository was originally empty and I copied and pasted all the dependencies from Maven 2's repository to Maven 3's repository. In the IDE, it was set that the Maven 3 's repository path overrides the bundled one.
The settings file was a minial existance of a Maven settings file, which only encloses an xml 1.0 header and a <settings> tab claiming namespaces. Therefore, the Apache Maven server was kept as the remote source. Neither mirror nor private Maven server was set up.

  • 新的Maven版本号是3.6.3。
  • 本来Maven3的仓库是空的,我把Maven2的整个仓库内容拷贝到Maven3下了,在IDE中设置替换了Maven的仓库。
  • 配置文件是最简化的,仅仅包含了一个XML台头和一个申明了命名空间的<settings>标签。所以仍旧保留了使用Apache的Maven服务器作为远端的代码源(可信)。没有设置服务镜像,也没有设置私服。

这里提供一个最简化的Maven配置文件。

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> </settings>

看上去像是网络问题,而且501像是 repo.maven.apache.org 出了问题,几个方面可以尝试:

  1. 在 settings.xml 里设置镜像,不直接用 repo.maven.apache.org 的服务器;
  2. 更换插件版本,如最新的 3.8.1;
  3. 建立 maven 私服。
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题