Reputation: 35
Whenever I try to build a Maven project I get the following Error:
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]
Trying to mvn clean
leads to a similar 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): 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]
Any idea what could solve the problem?
EDIT:
Netbeans 8.2
JDK 1.8.0_181
Windows 10 Pro 10.0.18363
Maven 3.6.3
No Proxy configured -> Also tried in different networks
Issue started happening suddenly after being a way from work for a week The week before it started every build worked. Suddenly even completely new projects get the error.
CMD line Maven commands also have this error
reinstalling Maven didn't help
Upvotes: 2
Views: 3740
Reputation: 2962
It looks like the problem appears because of corrupted or misconfigured Java truststore (cacerts). Here we have an answer where for example it was corrupted.
The maven tries to download the resource plugin, creates https connection, receives SSL server certificate and tries to validate it against the java truststore.
The default truststore locates here JAVA_HOME->JRE->lib->security->cacerts
(see answer)
I would suggest the following approach:
-Djavax.net.ssl.trustStoreType=pkcs12
parameter (should be jks).-Djavax.net.ssl.trustStore
. It could point to the corrupted trustore. Ether change it or point to the defalut truststore.Upvotes: 3