簡體   English   中英

通過 SBT 下載插件時如何修復 SSL 錯誤?

[英]How to fix SSL error when downloading plugin via SBT?

我有一個相當小的示例SBT 項目。

特別是,這是我的project/plugins.sbt

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")

這是我的project/build.properties

sbt.version = 1.2.8

加載我的項目時我在 SBT 中遇到的錯誤是這樣開始的:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.eed3si9n#sbt-assembly;0.14.9: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.9 {compile=[default(compile)]}::
[warn]  typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/ivys/ivy
.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certificat
ion path to requested target
[warn]  sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/iv
ys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid cert
ification path to requested target
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.eed3si9n:sbt-assembly:0.14.9 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          com.eed3si9n:sbt-assembly:0.14.9 (scalaVersion=2.12, sbtVersion=1.0) (/Users/dah/vc/noddy-akka-http/project/plugins.sbt#L1-2)
[warn]            +- default:noddy-akka-http-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)

並結束

[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.9: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.9 {compile=
[default(compile)]}::
[error]         typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/
ivys/ivy.xml: 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
[error]         sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/ivys/ivy.xml: 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

這是我安裝的JVM版本:

$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

雖然,當我運行sbt console (從沒有 SBT 項目的目錄)時,我得到:

Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

我有 macOS Mojave 10.14.5。

我假設我需要更新我的證書存儲。 我該怎么做?

或者我應該做些什么來解決這個問題?

通過執行 sbt 控制台仔細檢查 sbt 使用的 java 版本。 它應該說類似於Welcome to Scala 2.12.7 (OpenJDK 64-Bit Server VM, Java 1.8.0_202) 就我個人而言,我建議清理當前安裝並嘗試像這樣采用openjdk8

brew cask install adoptopenjdk8

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM