Search code examples
scalaplayframeworksbtflywaysbt-plugin

Error adding flyway-sbt plugin for Scala 2.12 (Play Framework)


TLDR: Are there any publically available jars for flyway-sbt for Scala 2.12 and SBT 1.0?


Has anyone else had issues with dependency resolution for flyway-sbt when using Scala 2.12? Looking at the URLs below, they indeed do not exist.

[warn]  module not found: org.flywaydb#flyway-sbt;4.0
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /Users/adu/.ivy2/local/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/adu/.sbt/preloaded/org.flywaydb/flyway-sbt/4.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/adu/.sbt/preloaded/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom
[warn] ==== Flyway: tried
[warn]   https://flywaydb.org/repo/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.flywaydb#flyway-sbt;4.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]    org.flywaydb:flyway-sbt:4.0 (scalaVersion=2.12, sbtVersion=1.0)
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]    org.flywaydb:flyway-sbt:4.0 (scalaVersion=2.12, sbtVersion=1.0) (/Users/adu/workspace/seed-play/project/plugins.sbt#L42-43)
[warn]      +- default:seed-play-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.flywaydb#flyway-sbt;4.0: not found

These are the additions to my plugins.sbt file:

resolvers += "Flyway" at "https://flywaydb.org/repo"
addSbtPlugin("org.flywaydb" % "flyway-sbt" % "4.0")

Solution

  • So it turns out Flyway has yet to publish official artifacts for flyway-sbt compatible with sbtVersion=1.x.

    After some digging, I found this Github issue.
    Which then lead to this new Github repository.
    The above is part of the Flyway github account, so it should be maintained.

    Replacing the additions to my plugins.sbt file with the following worked:

    resolvers += "Flyway" at "https://davidmweber.github.io/flyway-sbt.repo"
    addSbtPlugin("org.flywaydb" % "flyway-sbt" % "4.2.0")