简体   繁体   English

spring maven 安装或清理错误,为什么?

[英]spring maven install or clean error, why?

When I use maven install or clean for my spring project following error occurred.当我为我的 spring 项目使用 maven installclean ,发生了以下错误。

this problem was occurred in Eclipse 2018-09 version.这个问题出现在 Eclipse 2018-09 版本中。 when I use eclipse photon version, did not occur this problem.当我使用eclipse photon版本时,没有出现这个问题。

The error message.错误信息。

[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

Why can't maven install or clean .为什么不能 maven installclean

It seems that this problem occurs when you run Maven with the JDK7.当您使用JDK7运行Maven时,似乎会出现此问题。

It worked until April 2019, but then it stopped working failing the Maven build with this error.它一直工作到 2019 年 4 月,但随后它停止工作,因为此错误导致 Maven 构建失败。

Java 7 uses TLS v1 as default, so open a terminal and run mvn and specify TLS v1.2 version: Java 7 默认使用TLS v1 ,因此打开终端并运行 mvn 并指定TLS v1.2版本:

mvn -Dhttps.protocols=TLSv1.2 clean install

More info 更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM