未解决的依赖关系:sbt-plugin;2.7.0 尝试编译播放模板项目时

Posted

技术标签:

【中文标题】未解决的依赖关系:sbt-plugin;2.7.0 尝试编译播放模板项目时【英文标题】:Unresolved dependency: sbt-plugin;2.7.0 when trying to compile a play template project 【发布时间】:2019-03-02 00:38:10 【问题描述】:

按照 Play 网站“sbt new playframework/play-scala-seed.g8”的指导创建了一个新的播放模板项目

尝试编译/运行项目我得到以下信息:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#sbt-plugin;2.7.0: Resolution failed several times for dependency: com.typesafe.play#sbt-plugin;2.7.0 compile=[default(compile)]:: 
[warn]  typesafe-ivy-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/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
[warn]  sbt-plugin-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/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
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.typesafe.play:sbt-plugin:2.7.0 (scalaVersion=2.12, sbtVersion=1.0)
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      com.typesafe.play:sbt-plugin:2.7.0 (scalaVersion=2.12, sbtVersion=1.0) (/Users/ramin/Desktop/playground/project/plugins.sbt#L1-2)
[warn]        +- default:playground-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)

我的 Scala 版本是 2.12.4,我确实安装了 sbt 1.0,所以对为什么会发生这种情况有点困惑。有什么想法吗?

【问题讨论】:

这个解释可能是一个提示:littlebigextra.com/… 您是否手动安装过 OpenJDK 或 GraalVM?如果是这样,那么这个问题可能是相关的:github.com/oracle/graal/issues/378github.com/oracle/graal/issues/493 【参考方案1】:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000094584-IDEA-Ultimate-2016-3-4-throwing-unable-to-find-valid-certification-path-to-requested-target-when-trying-to-refresh-gradle?page=1#community_comment_115000405564

如果您遵循此处的响应,然后使用 repo.scala-sbt.org 代替 google.com 部分

像这样:

回声-n | openssl s_client -connect repo.scala-sbt.org:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/scala.cer

按照链接中的其余说明进行操作,它应该可以工作。

【讨论】:

这应该被标记为正确答案。对我来说就像一个魅力!

以上是关于未解决的依赖关系:sbt-plugin;2.7.0 尝试编译播放模板项目时的主要内容,如果未能解决你的问题,请参考以下文章

超时解决 sbt-plugin

未解决的依赖sbt-play-ebean

如何通过将 sbt-plugin 用作多项目构建中的依赖项来访问它的子项目?

安装GTK开发环境,未满足依赖关系,如何解决

公共编解码器的未解决依赖关系

由于未解决的依赖关系,无法使用 Winforms 控件