Java SpringMaven安装或清理错误,为什么?

Java SpringMaven安装或清理错误,为什么?,java,spring,maven,installation,Java,Spring,Maven,Installation,当我为我的spring项目使用maveninstall或clean时,出现以下错误 此问题发生在Eclipse 2018-09版本中。 当我使用eclipse光子版本时,没有出现这个问题 错误消息 [INFO] Scanning for projects... [INFO] [INFO] -----------------------------< >----------------------------- [INFO] Building 1.0.0-BUILD-SNAPSH

当我为我的spring项目使用maven
install
clean
时,出现以下错误

此问题发生在Eclipse 2018-09版本中。 当我使用eclipse光子版本时,没有出现这个问题

错误消息

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------------<  >-----------------------------
[INFO] Building  1.0.0-BUILD-SNAPSHOT
[INFO] --------------------------------    [  war ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.442 s
[INFO] Finished at: 2018-12-02T23:32:35+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR]       role: org.apache.maven.wagon.Wagon
[ERROR]   roleHint: https
[ERROR] ->     [ 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
[INFO]正在扫描项目。。。
[信息]
[信息]-------------------------------------<>-----------------------------
[信息]构建1.0.0-BUILD-SNAPSHOT
[信息]------------------------------------[战争]---------------------------------
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:0.442秒
[信息]完成时间:2018-12-02T23:32:35+09:00
[信息]------------------------------------------------------------------------
[错误]Plugin org.apache.maven.plugins:maven-surefire-Plugin:2.12.4或其一个依赖项无法解析:无法读取org.apache.maven的工件描述符。plugins:maven-surefire-Plugin:jar:2.12.4:无法将工件org.apache.maven.plugins:maven-surefire-Plugin:pom:2.12.4从/传输到中心(https://repo.maven.apache.org/maven2):无法访问https://repo.maven.apache.org/maven2 使用可用的连接器工厂:BasicRepositoryConnectorFactory:无法访问https://repo.maven.apache.org/maven2 使用已注册的transporter工厂:WagoTransporterFactory:java.util.NoSuchElementException
[错误]角色:org.apache.maven.wagen.wagen
[错误]角色提示:https
[错误]->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

为什么maven
不能安装
清理

当您使用JDK7运行maven时,似乎会出现此问题


它一直工作到2019年4月,但由于出现此错误而导致Maven构建失败而停止工作。

Java 7使用
TLS v1
作为默认值,因此打开一个终端并运行mvn并指定
TLS v1.2
版本:

mvn -Dhttps.protocols=TLSv1.2 clean install

您是否在防火墙或代理后运行maven build?查看是否可以连接
https://repo.maven.apache.org/maven2
在您的浏览器中,我可以看到我的浏览器列表。同样的问题。您是在防火墙后运行maven build还是在代理后运行maven build?否。我的本地环境昨天正常工作。但出现了其他问题,因此我删除了.m2文件夹并重试maven安装。使用Java 8运行maven对我来说很有效!知道发生了什么变化吗?可能是HTTPS协议有了新的策略,所以JDK 7在必须从maven存储库下载依赖项时出现了一些问题。