(提取结构失败:构建状态:错误)无法在插件中导入插件到scala,sbt文件

mo49yndu  于 2023-04-30  发布在  Scala
关注(0)|答案(1)|浏览(336)

我正在尝试使用sbt-native-packager来创建scala项目的Docker Image。我必须添加sbt-native-packager插件。为此,我创建了“插件”。sbt”文件在book_system_task/project/plugins中。sbt(其中book_system_task是我的应用程序名称)。
plugins.sbt:

addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.4")

但是在加载sbt更改时,它给出以下错误:

Extracting structure failed: Build status: Error

我现在使用的是scala版本:2.13.1,sbt-version:1.2.8.

dpiehjr4

dpiehjr41#

错误是

[error] sbt.internal.IncompatiblePluginsException: Binary incompatibility in plugins detected.
...
[error] Caused by: java.lang.NoSuchMethodError: sbt.package$.singleFileJsonFormatter()Lsjsonnew/JsonFormat;

方法sbt.package$.singleFileJsonFormatter()出现在sbt 1中。3.0
https://github.com/sbt/sbt/blob/v1.3.0/sbt/src/main/scala/package.scala#L48
https://github.com/sbt/sbt/blob/v1.2.8/sbt/src/main/scala/package.scala

implicit val singleFileJsonFormatter: JsonFormat[File] = FileStamp.Formats.fileJsonFormatter

所以sbt-native-packager 1.9.4似乎与sbt 1二进制不兼容。2.8-
将sbt升级到1。3.0+ in project/build.properties(当前sbt为1。8.2)或像您在下一个问题Unable to make docker image using sbt-native-packager中所做的那样降级sbt-native-packager

相关问题