【发布时间】:2018-12-05 08:20:08
【问题描述】:
我有一个需要处理的 Maven 项目。我安装了 Eclipse SE(Mars 2,因为我需要在 JDK 1.7 上工作),并且只是尝试将项目导入为 an existing Maven project,但在 Eclipse 中出现此错误:
我从 here 下载了 maven 3.5.4 并将 bin 添加到我的路径中。现在我尝试从项目文件夹中的命令行mvn clean,我收到此错误:
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.792 s
[INFO] Finished at: 2018-06-26T09:42:32-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
看起来这是一个常见错误,但我还无法修复它。如何解决?我在.m2 文件夹中没有看到settings.xml。
【问题讨论】:
-
你有什么 Java 1.7 版本?尝试使用最新的,如果没有帮助,请查看 stackoverflow.com/questions/39157422/…。
-
java version "1.7.0_80"... 我被告知该项目仅与 Java 7 兼容。 -
我读到这已在 1.7.0_131 中修复,但显然 80 是公开可用的最新版本。设置 -Dhttps.protocols=TLSv1.2(见上面的链接)。
-
我将 MAVEN_OPTS 更新为
-Dhttps.protocols=TLSv1.2 -Xms256m -Xmx512m...仍然有同样的问题。 -
尝试删除 .m2 文件夹中的所有内容并再次运行 maven。
标签: java eclipse maven eclipse-plugin pom.xml