Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
268 views
in Technique[技术] by (71.8m points)

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]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...