0

This is a simple scala project. I have added sbt-liquibase to plugins.sbt. My changelog for liquibase is in yaml format. According to https://docs.liquibase.com/concepts/changelogs/yaml-format.html, the snakeyaml should be used for changelog in yaml format. Since, I sbt-liquibase plugin, I could not find where should the dependency be declared for sbt-liquibase plugin.

//plugins.sbt
addSbtPlugin("com.permutive" % "sbt-liquibase" % "1.2.0")

build.sbt is

//build.sbt
lazy val root = (project in file("."))
  .settings(
    name                        := "diy-quill",
    libraryDependencies ++=Seq(
      sqlite,

    ),
    liquibaseChangelog          := java.nio.file.Path.of("src/main/resources/db/changelog.yaml").toFile(),
    liquibaseDriver             := "org.sqlite.JDBC",
    liquibaseUrl                := "jdbc:sqlite:./target/shopkart.db",
    liquibaseUsername           := "",
    liquibasePassword           := ""
  )
  .enablePlugins(ScalafmtPlugin)
  .enablePlugins(SbtLiquibase)

Since sbt-liquibase could not find yaml parser, I get the following error on executing the task liquibaseUpdate.

sbt:hello-world> liquibaseUpdate
[error] stack trace is suppressed; run last liquibaseUpdate for the full output
[error] (liquibaseUpdate) liquibase.exception.UnknownChangelogFormatException: Cannot find parser that supports /home/dx/dev/play/scala-projects/diy-quill/src/main/resources/db/changelog.yaml
[error] Total time: 0 s, completed Mar 2, 2023, 4:24:04 PM

Where and how should the dependency for sbt-liquibase plugin be declared?

Application does not require snakeyaml.

However, when the liquibase changelog is represented in xml format, no additional dependencies are required, no such errors occur.

Found a stackoverflow reference Sbt Plugin Add Dependency to project/build.sbt which recommends to use compilerPlugin. Even that did not help.

nashter
  • 1,181
  • 1
  • 15
  • 33

1 Answers1

0

Adding snakeyaml to plugins.sbt solves the issue. This is project/plugins.sbt looks like to use changelog for sbt-liquibase in yaml format.

addSbtPlugin("com.permutive" % "sbt-liquibase" % "1.2.0")
libraryDependencies ++= Seq(
  "org.yaml" % "snakeyaml" % "1.33"
)
nashter
  • 1,181
  • 1
  • 15
  • 33