直接參考前面一篇文章中間介紹的第2種方法即可:Maven:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
再 maven 命令中增加運行參數如下,路徑可以改為自己的 JDK 安裝路徑,筆者的是:C:\cs-softwares\Java\jdk1.8.0_111
-Djavax.net.ssl.trustStore=C:\cs-softwares\Java\jdk1.8.0_111\jre\lib\security\cacerts
-Djavax.net.ssl.trustAnchors=C:\cs-softwares\Java\jdk1.8.0_111\jre\lib\security\cacerts