无法让 sbt-plugin 或 sbt-play-ebean 与 Play 2.8.0 和 sbt 1.5.5 一起使用

Cannot get sbt-plugin nor sbt-play-ebean to work with Play 2.8.0 and sbt 1.5.5

在中断三年后回到 Play Framework 并尝试从最新的 Play (2.8.0) 和 sbt (1.5.5) 开始。

我正在尝试获取项目 运行 并收到此消息:

[info] welcome to sbt 1.5.5 (Oracle Corporation Java 1.8.0_41)
[info] loading settings for project global-plugins from plugins.sbt ...
[info] loading global plugins from C:\Users\dzell\.sbt.0\plugins
[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.8.0 (sbtVersion=1.0, scalaVersion=2.12)
[warn]          com.typesafe.sbt:sbt-play-ebean:4.0.6 (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn]  Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:sbt-plugin;sbtVersion=1.0;scalaVersion=2.12:2.8.0

在我的 plugins.sbt 文件中,我有:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.0.6")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

在我的 build.sbt 文件中,我有:

scalaVersion := "2.13.6"

运行:

C:\Users\dzell>java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) Client VM (build 25.301-b09, mixed mode, sharing)

C:\Users\dzell>javac -version
javac 1.8.0_41

我猜是版本冲突,但不确定如何解决。我找到了其他帖子,但他们没有给我答案:

Play! Framework and SBT - Problems with ebeans module

SBT. Resolving dependencies for play sbt-plugin

Unresolved dependency sbt-play-ebean

我应该像错误消息中所说的那样只使用 sbt 1.0 和 scala 2.12 吗?

感谢您的帮助 - 期待重新开始游戏。

---------------- 编辑 2021 年 8 月 2 日 - 专注于 ivy.xml:

截至目前,我有 .ivy2 文件夹,但该文件夹内没有文件夹 - 只有一个名为 .sbt.ivy.lock 的文件。我从上面的错误中尝试了这个URL,它让我下载了一个文件: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.8.0/ivys/ivy.xml

我尝试手动创建错误中列出的文件夹结构:

C:\Users\dzell\.ivy2\localcom.typesafe.play\sbt-plugin\scala_2.12\sbt_1.0.8.0\ivys\ivy.xml

我把下载的文件放在上面的那个文件夹里,但是没有修复错误。

---------------- 编辑 7/29/2021 - 添加完整错误:

[warn]  Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:sbt-plugin;sbtVersion=1.0;scalaVersion=2.12:2.8.0
[error]   Not found
[error]   Not found
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.12_1.0/2.8.0/sbt-plugin-2.8.0.pom
[error]   not found: C:\Users\dzell\.ivy2\localcom.typesafe.play\sbt-plugin\scala_2.12\sbt_1.0.8.0\ivys\ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.8.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.8.0/ivys/ivy.xml
[error] Error downloading com.typesafe.sbt:sbt-play-ebean;sbtVersion=1.0;scalaVersion=2.12:4.0.6
[error]   Not found
[error]   Not found
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-play-ebean_2.12_1.0/4.0.6/sbt-play-ebean-4.0.6.pom
[error]   not found: C:\Users\dzell\.ivy2\localcom.typesafe.sbt\sbt-play-ebean\scala_2.12\sbt_1.0.0.6\ivys\ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-play-ebean/scala_2.12/sbt_1.0/4.0.6/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-play-ebean/scala_2.12/sbt_1.0/4.0.6/ivys/ivy.xm
[error]         at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:258)
[error]         at lmcoursier.CoursierDependencyResolution.$anonfun$update(CoursierDependencyResolution.scala:227)
[error]         at lmcoursier.CoursierDependencyResolution$$Lambda28/4493266.apply(Unknown Source)
[error]         at scala.util.Either$LeftProjection.map(Either.scala:573)
[error]         at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:227)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error]         at sbt.internal.LibraryManagement$.resolve(LibraryManagement.scala:59)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:133)
[error]         at sbt.internal.LibraryManagement$$$Lambda04/9760435.apply(Unknown Source)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput(Tracked.scala:73)
[error]         at sbt.util.Tracked$$$Lambda22/23600241.apply(Unknown Source)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:146)
[error]         at sbt.internal.LibraryManagement$$$Lambda06/1799764.apply(Unknown Source)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:146)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$adapted(LibraryManagement.scala:127)
[error]         at sbt.internal.LibraryManagement$$$Lambda00/19618076.apply(Unknown Source)
[error]         at sbt.util.Tracked$.$anonfun$inputChangedW(Tracked.scala:219)
[error]         at sbt.util.Tracked$$$Lambda44/32581439.apply(Unknown Source)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
[error]         at sbt.Classpaths$.$anonfun$updateTask0(Defaults.scala:3678)
[error]         at sbt.Classpaths$$$Lambda4/6222801.apply(Unknown Source)
[error]         at scala.Function1.$anonfun$compose(Function1.scala:49)
[error]         at scala.Function1$$Lambda3/9144307.apply(Unknown Source)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219(TypeFunctions.scala:62)
[error]         at sbt.internal.util.$tilde$greater$$Lambda11/14105697.apply(Unknown Source)
[error]         at sbt.std.Transform$$anon.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit(Execute.scala:282)
[error]         at sbt.Execute$$Lambda43/26297029.apply(Unknown Source)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit(Execute.scala:282)
[error]         at sbt.Execute$$Lambda21/15687584.apply(Unknown Source)
[error]         at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:265)
[error]         at sbt.ConcurrentRestrictions$$anon$$Lambda34/23267753.apply(Unknown Source)
[error]         at sbt.CompletionService$$anon.call(CompletionService.scala:64)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error]         at java.lang.Thread.run(Thread.java:745)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:sbt-plugin;sbtVersion=1.0;scalaVersion=2.12:2.8.0
[error]   Not found
[error]   Not found
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.12_1.0/2.8.0/sbt-plugin-2.8.0.pom
[error]   not found: C:\Users\dzell\.ivy2\localcom.typesafe.play\sbt-plugin\scala_2.12\sbt_1.0.8.0\ivys\ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.8.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.8.0/ivys/ivy.xml
[error] Error downloading com.typesafe.sbt:sbt-play-ebean;sbtVersion=1.0;scalaVersion=2.12:4.0.6
[error]   Not found
[error]   Not found
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-play-ebean_2.12_1.0/4.0.6/sbt-play-ebean-4.0.6.pom
[error]   not found: C:\Users\dzell\.ivy2\localcom.typesafe.sbt\sbt-play-ebean\scala_2.12\sbt_1.0.0.6\ivys\ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-play-ebean/scala_2.12/sbt_1.0/4.0.6/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-play-ebean/scala_2.12/sbt_1.0/4.0.6/ivys/ivy.xml

查看 Java/JRE/JDK 安装后,我注意到没有 cacerts 文件。我卸载了 Java/JRE/JDK - 确保删除了所有 references/folders/files。

我创建了一个 Oracle 帐户来从 Oracle 的站点下载安装文件,因为 OpenJDK 给我带来了问题。

我先下载并安装了 Java/JRE 文件 jre-8u301-windows-x64.exe。我通过在命令提示符中使用 java -version 确保安装了 Java。我很高兴。

然后我下载并安装了 JDK 文件 jdk-8u301-windows-x64.exe。我通过在命令提示符中使用 javac -version 确保安装了 Java。我很高兴。

我启动了 sbt 并且没有任何问题 - 它已修复。