Idea中发布JAR包到中央仓库报错问题处理 unable to find valid certification path to requested targ

17 阅读1分钟

 报错信息如下:

Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project spring-redis-current-limit: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: Nexus connection problem to URL [oss.sonatype.org/ ]: com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

image.png

解决方法:

增加配置参数,位置:File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner,修改界面中VM Options参数为:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

 image.png

码觉客微信公众号