Zaryab Ali
Zaryab Ali

Reputation: 151

(Extracting structure failed: Build status: Error) Unable to import plugin to scala in plugins.sbt file

I'm trying to use sbt-native-packager to make Docker Image of scala project. I have to add sbt-native-packager plugin. For that, I've created "plugins.sbt" file in book_system_task/project/plugins.sbt (where book_system_task is my application name).

plugins.sbt:

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

But on loading sbt changes, it gives following error:

Extracting structure failed: Build status: Error

I'm currently using, scala-version: 2.13.1, sbt-version:1.2.8.

Upvotes: 0

Views: 178

Answers (1)

Dmytro Mitin
Dmytro Mitin

Reputation: 51648

The error is

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

Method sbt.package$.singleFileJsonFormatter() appeared in 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

So sbt-native-packager 1.9.4 seems to be binary incompatible with sbt 1.2.8-

Either upgrade sbt to 1.3.0+ in project/build.properties (current sbt is 1.8.2) or downgrade sbt-native-packager as you did in your next question Unable to make docker image using sbt-native-packager

Upvotes: 1

Related Questions