Work logs, certificates invalid unable to find valid certification path to requested target

Work logs, certificates invalid unable to find valid certification path to requested target

This problem was recently made a large head. Cause all uses se.transmode.gradle:gradle-docker:1.2of all projects can not start! I do not know why this is so, but other colleagues of the project can be properly packaged to run! Spent a lot of half-time finally toss well.

abnormal situation:

Exception log:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'xxxx'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
    ... 91 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.github.jnr:jffi:[1.2.1, 1.3.0).
Required by:
    project : > se.transmode.gradle:gradle-docker:1.2 > com.github.docker-java:docker-java:0.9.0 > com.github.jnr:jnr-unixsocket:0.3 > com.github.jnr:jnr-ffi:1.0.3
    ... 110 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Failed to list versions for com.github.jnr:jffi.
    ... 136 more
Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/com/github/jnr/jffi/maven-metadata.xml.
    ... 142 more
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://repo.maven.apache.org/maven2/com/github/jnr/jffi/maven-metadata.xml'.
    ... 149 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ... 168 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ... 190 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ... 196 more

Solutions

Internet to find some solutions are added to the local post-export certificate. First I encountered this problem and did not know where to export the certificate. Log in to see the prompt Failed to list versions for com.github.jnr:jffi.. I began to suspect that is because the certificate error caused the failure, so maven repository will jffibe imported and added to the local certificate, restart IDEA, failed. Moment, confused. I began to try to import the certificate to other URLs; try another gradle docker plugin; even restart the computer use both methods. Toss for a long time, the result ended in failure.

And finally re-read it again log se.transmode.gradle:gradle-docker:1.2 > com.github.docker-java:docker-java:0.9.0 > com.github.jnr:jnr-unixsocket:0.3 > com.github.jnr:jnr-ffi:1.0.3holding a try of the mentality of try to import the jnr-ffi:1.0.3certificate, the result is successful, the mentality jumped. He jumped. A.

Specific steps

The first step: analysis of the log that lists the suspect jar certificate becomes invalid.

Step two: enter maven repository (possibly PW), find the corresponding jar page.

The third step: to export the certificate to a local

Step four: Open cmd window as an administrator, execute ./keytool -import -alias 别名 -keystore cacerts -file 证书地址the command to add certificate, suggesting that "the certificate has been added to keystore" button.

Step five: Restart IDEA

If one did not succeed, you can put other suspect objects are added.

Guess you like

Origin www.cnblogs.com/itdragon/p/11592178.html