postgresql - Sbt FlywayMigrate Command Hanging after Upgrading Flyway Sbt - Stack Overflow

After upgrading flyway-sbt from 7.4.0 to 9.22.0 the sbt flywayMigrate command now hangs, e.g.| =>

After upgrading flyway-sbt from 7.4.0 to 9.22.0 the sbt flywayMigrate command now hangs, e.g. | => root / flywayMigrate {x}s . In our migration scripts, we are creating the indexes concurrently.

Versions: sbt: 1.6.0 jdk: 11.0.24 sbt-play: 2.8.8 scala-sbt: 2.12.15 flyway-play: 7.14.0

build.sbt:

import com.typesafe.config.ConfigFactory


lazy val root = (project in file("."))
  .enablePlugins(PlayScala, FlywayPlugin)
  .configs(ITest)
  .settings(inConfig(ITest)(Defaults.itSettings): _*)

lazy val conf = ConfigFactory.parseFile(new File("conf/application.conf")).resolve()

lazy val ITest = config("it") extend Test
scalaSource in ITest := baseDirectory.value / "/test-integration"
resourceDirectory in ITest := baseDirectory.value / "/test-integration/resources"

version := conf.getString("app.version")

scalaVersion := "2.12.15"
val akkaVersion = play.core.PlayVersion.akkaVersion


// Dependencies
libraryDependencies ++= Seq(
  guice,
  ws,
  ".skinny-framework"        %% "skinny-orm"                   % "3.1.0"           withSources(),
  ".scalikejdbc"             %% "scalikejdbc-play-initializer" % "2.8.0-scalikejdbc-3.5"withSources(),
  ".scalikejdbc"             %% "scalikejdbc"                  % "3.3.1"           withSources(),
  "com.typesafe.play"           %% "play-slick"                   % "5.0.2"           withSources(),
  "com.auth0"                    % "java-jwt"                     % "3.2.0", // Don't update it! will have jackson conflict
  ".scalatestplus.play"      %% "scalatestplus-play"           % "5.1.0"           % Test,
  ".scalatestplus"           %% "mockito-5-12"                 % "3.2.19.0"        % Test,
  ".mockito"                  % "mockito-all"                  % "1.10.19"         % Test,
  "com.amazonaws"                % "aws-java-sdk"                 % "1.11.313",
  ".flywaydb"                %% "flyway-play"                  % "7.14.0",
  ".postgresql"               % "postgresql"                   % "42.2.2",
  "com.chuusai"                 %% "shapeless"                    % "2.3.3",
  ".typelevel"               %% "cats-core"                    % "1.1.0",
  ".lyranthe.prometheus"     %% "client"                       % "0.9.0-M5",
  "io.split.client"              % "java-client"                  % "2.3.1",
  "com.segment.analytics.java"   % "analytics"                    % "2.1.0",
  "it.innove"                    % "play2-pdf"                    % "1.9.1",
  ".webjars"                  % "swagger-ui"                   % "2.2.0",
  "com.fasterxml.jackson.module" %% "jackson-module-scala"        % "2.11.4",
  "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310"    % "2.11.4",
  "com.github.jasminb"             % "jsonapi-converter"          % "0.11",
  "de.leanovate.play-mockws"    %% "play-mockws"                  % "2.8.1"            % Test,
  ".scalatest"                %% "scalatest"                   % "3.2.19"           % Test,
  "javax.xml.bind"               % "jaxb-api"                     % "2.3.1",
  ".scala-lang"               % "scala-compiler"               % scalaVersion.value,
  ".scala-lang"               % "scala-reflect"                % scalaVersion.value,
  ".scala-lang"               % "scala-library"                % scalaVersion.value,
  "com.typesafe.play"            %% "play"                        % "2.8.8",
  "com.typesafe.play"            %% "play-guice"                  % "2.8.8",
  "com.typesafe.play"            %% "play-test"                   % "2.8.8"           % Test,
  "com.typesafe.akka"            %% "akka-testkit"                % akkaVersion       % Test,
  "com.typesafe.akka"            %% "akka-http"                   % "10.2.10"         % Test,
  "com.typesafe"                 %% "ssl-config-core"             % "0.4.3",
)

// .6.x/framework/project/Dependencies.scala#L11
dependencyOverrides ++= Seq(
  "com.typesafe.akka"           %% "akka-actor"                % akkaVersion      withSources(),
  "com.typesafe.akka"           %% "akka-stream"               % akkaVersion      withSources(),
  "com.google.guava"             % "guava"                     % "33.4.0-jre",
  ".slf4j"                    % "slf4j-api"                 % "1.7.36",
  ".bitbucket.b_c"            % "jose4j"                    % "0.9.6",
  ".scala-lang.modules"      %% "scala-xml"                 % "2.1.0"
)

plugins.sbt

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")

// workaround for missing static SLF4J binder for logback
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"

// Scala style plugin
addSbtPlugin(".scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

// SBT coverage plugin
addSbtPlugin(".scoverage" % "sbt-scoverage" % "1.9.3")

// Flyway plugin
addSbtPlugin("com.github.sbt" % "flyway-sbt" % "9.22.0")

// SBT Dependency Graph plugin
addDependencyTreePlugin

// Play swagger Docs
addSbtPlugin("io.github.play-swagger" % "sbt-play-swagger" % "1.6.1")

Tried adding flyway.postgresql.transactional.lock = false to application.conf but not working

After upgrading flyway-sbt from 7.4.0 to 9.22.0 the sbt flywayMigrate command now hangs, e.g. | => root / flywayMigrate {x}s . In our migration scripts, we are creating the indexes concurrently.

Versions: sbt: 1.6.0 jdk: 11.0.24 sbt-play: 2.8.8 scala-sbt: 2.12.15 flyway-play: 7.14.0

build.sbt:

import com.typesafe.config.ConfigFactory


lazy val root = (project in file("."))
  .enablePlugins(PlayScala, FlywayPlugin)
  .configs(ITest)
  .settings(inConfig(ITest)(Defaults.itSettings): _*)

lazy val conf = ConfigFactory.parseFile(new File("conf/application.conf")).resolve()

lazy val ITest = config("it") extend Test
scalaSource in ITest := baseDirectory.value / "/test-integration"
resourceDirectory in ITest := baseDirectory.value / "/test-integration/resources"

version := conf.getString("app.version")

scalaVersion := "2.12.15"
val akkaVersion = play.core.PlayVersion.akkaVersion


// Dependencies
libraryDependencies ++= Seq(
  guice,
  ws,
  ".skinny-framework"        %% "skinny-orm"                   % "3.1.0"           withSources(),
  ".scalikejdbc"             %% "scalikejdbc-play-initializer" % "2.8.0-scalikejdbc-3.5"withSources(),
  ".scalikejdbc"             %% "scalikejdbc"                  % "3.3.1"           withSources(),
  "com.typesafe.play"           %% "play-slick"                   % "5.0.2"           withSources(),
  "com.auth0"                    % "java-jwt"                     % "3.2.0", // Don't update it! will have jackson conflict
  ".scalatestplus.play"      %% "scalatestplus-play"           % "5.1.0"           % Test,
  ".scalatestplus"           %% "mockito-5-12"                 % "3.2.19.0"        % Test,
  ".mockito"                  % "mockito-all"                  % "1.10.19"         % Test,
  "com.amazonaws"                % "aws-java-sdk"                 % "1.11.313",
  ".flywaydb"                %% "flyway-play"                  % "7.14.0",
  ".postgresql"               % "postgresql"                   % "42.2.2",
  "com.chuusai"                 %% "shapeless"                    % "2.3.3",
  ".typelevel"               %% "cats-core"                    % "1.1.0",
  ".lyranthe.prometheus"     %% "client"                       % "0.9.0-M5",
  "io.split.client"              % "java-client"                  % "2.3.1",
  "com.segment.analytics.java"   % "analytics"                    % "2.1.0",
  "it.innove"                    % "play2-pdf"                    % "1.9.1",
  ".webjars"                  % "swagger-ui"                   % "2.2.0",
  "com.fasterxml.jackson.module" %% "jackson-module-scala"        % "2.11.4",
  "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310"    % "2.11.4",
  "com.github.jasminb"             % "jsonapi-converter"          % "0.11",
  "de.leanovate.play-mockws"    %% "play-mockws"                  % "2.8.1"            % Test,
  ".scalatest"                %% "scalatest"                   % "3.2.19"           % Test,
  "javax.xml.bind"               % "jaxb-api"                     % "2.3.1",
  ".scala-lang"               % "scala-compiler"               % scalaVersion.value,
  ".scala-lang"               % "scala-reflect"                % scalaVersion.value,
  ".scala-lang"               % "scala-library"                % scalaVersion.value,
  "com.typesafe.play"            %% "play"                        % "2.8.8",
  "com.typesafe.play"            %% "play-guice"                  % "2.8.8",
  "com.typesafe.play"            %% "play-test"                   % "2.8.8"           % Test,
  "com.typesafe.akka"            %% "akka-testkit"                % akkaVersion       % Test,
  "com.typesafe.akka"            %% "akka-http"                   % "10.2.10"         % Test,
  "com.typesafe"                 %% "ssl-config-core"             % "0.4.3",
)

// https://github/playframework/playframework/blob/2.6.x/framework/project/Dependencies.scala#L11
dependencyOverrides ++= Seq(
  "com.typesafe.akka"           %% "akka-actor"                % akkaVersion      withSources(),
  "com.typesafe.akka"           %% "akka-stream"               % akkaVersion      withSources(),
  "com.google.guava"             % "guava"                     % "33.4.0-jre",
  ".slf4j"                    % "slf4j-api"                 % "1.7.36",
  ".bitbucket.b_c"            % "jose4j"                    % "0.9.6",
  ".scala-lang.modules"      %% "scala-xml"                 % "2.1.0"
)

plugins.sbt

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")

// workaround for missing static SLF4J binder for logback
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"

// Scala style plugin
addSbtPlugin(".scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

// SBT coverage plugin
addSbtPlugin(".scoverage" % "sbt-scoverage" % "1.9.3")

// Flyway plugin
addSbtPlugin("com.github.sbt" % "flyway-sbt" % "9.22.0")

// SBT Dependency Graph plugin
addDependencyTreePlugin

// Play swagger Docs
addSbtPlugin("io.github.play-swagger" % "sbt-play-swagger" % "1.6.1")

Tried adding flyway.postgresql.transactional.lock = false to application.conf but not working

Share Improve this question asked Feb 3 at 4:09 OrionOrion 1
Add a comment  | 

1 Answer 1

Reset to default 2

We use flyway directly, and the only option was to pass the parameter like this:

Flyway
  .configure()
  .configuration(java.util.Map.of("flyway.postgresql.transactional.lock", "false"))
  ...

Try to look if there's a way to override the plugin configuration in this way. ^^

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745249818a4618610.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信