每当我尝试构建Maven项目时,都会出现以下错误:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be
resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6:
Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central
(https://repo.maven.apache.org/maven2): Transfer failed for
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-
plugin-2.6.pom: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm:
Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext):
DerInputStream.getLength(): lengthTag=109, too big. -> [Help 1]
尝试mvn clean
会导致类似的错误。
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): Transfer failed for
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-
2.5.pom: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default,
provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext): DerInputStream.getLength():
lengthTag=109, too big. -> [Help 1]
有什么办法可以解决问题吗?
编辑:
Netbeans 8.2
JDK 1.8.0_181
Windows 10 Pro 10.0.18363
Maven 3.6.3
未配置代理->在其他网络中也尝试过
下班一周后,这个问题突然开始发生 开始构建之前的一周,每个构建都起作用了。甚至是全新的项目也会突然出现错误。
CMD行Maven命令也有此错误
重新安装Maven没有帮助
答案 0 :(得分:1)
问题似乎是由于Java信任库(证书)损坏或配置错误而出现的。这里有一个答案,例如它是corrupted。
Maven尝试下载资源插件,创建https连接,接收SSL服务器证书,并尝试根据Java信任库对其进行验证。
默认信任库位于JAVA_HOME->JRE->lib->security->cacerts
(see answer)
我建议采用以下方法:
-Djavax.net.ssl.trustStoreType=pkcs12
parameter(应该是jks)。-Djavax.net.ssl.trustStore
。它可能指向腐败的托拉斯。以太更改它或指向默认的信任库。