kxbmap / sbt-jooq

jOOQ plugin for SBT 1.3+
Apache License 2.0
26 stars 6 forks source link

Usage with PlayFramework 2.8.19 version conflict(s) in library dependencies #30

Closed schube closed 1 year ago

schube commented 1 year ago

Hello!

Thank you for your tool! I upgraded a PlayFramework Project v2.7.3 with your plugin addSbtPlugin("com.github.kxbmap" % "sbt-jooq" % "0.4.1") to PlayFramework Project v2.8.19 and addSbtPlugin("com.github.kxbmap" % "sbt-jooq-codegen" % "0.7.1")

Now when I try to run sbt I get:

[info] welcome to sbt 1.7.2 (BellSoft Java 17.0.5)
[info] loading settings for project dpm-server-build from plugins.sbt ...
[info] loading project definition from /Users/schube/Documents/eclipse-workspace/dpm-server/project
[error] java.lang.RuntimeException: found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error]
[error]     * org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over {1.2.0, 1.1.1, 1.0.6}
[error]         +- com.github.kxbmap:sbt-jooq-codegen:0.7.1 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.1.0)
[error]         +- org.scala-lang:scala-compiler:2.12.16              (depends on 1.0.6)
[error]         +- com.typesafe.sbt:sbt-native-packager:1.5.2 (scalaVersion=2.12, sbtVersion=1.0) (depends on 1.1.1)
[error]         +- com.typesafe.play:twirl-api_2.12:1.5.1             (depends on 1.2.0)
[error]
[error]
[error] this can be overridden using libraryDependencySchemes or evictionErrorLevel
[error]     at scala.sys.package$.error(package.scala:30)
[error]     at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:89)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:133)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:146)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:146)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:127)
[error]     at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
[error]     at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3687)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]     at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]     at sbt.Execute.work(Execute.scala:291)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error]     at java.base/java.lang.Thread.run(Thread.java:833)
[error] (update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error]
[error]     * org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over {1.2.0, 1.1.1, 1.0.6}
[error]         +- com.github.kxbmap:sbt-jooq-codegen:0.7.1 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.1.0)
[error]         +- org.scala-lang:scala-compiler:2.12.16              (depends on 1.0.6)
[error]         +- com.typesafe.sbt:sbt-native-packager:1.5.2 (scalaVersion=2.12, sbtVersion=1.0) (depends on 1.1.1)
[error]         +- com.typesafe.play:twirl-api_2.12:1.5.1             (depends on 1.2.0)
[error]
[error]
[error] this can be overridden using libraryDependencySchemes or evictionErrorLevel

Unfortunately, I am not good at all with sbt so I do not really know how to solve this problem. Or is this something only you could fix with a new release? Or is this a PlayFrameWork error?

Any help is appreciated.

Thank you, schube

kxbmap commented 1 year ago

Thank you for the report.

This is because Play depends on an old version of scala-xml.

You can workaround this by writing the following code in project/plugins.sbt.

ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
schube commented 1 year ago

That seems to work, thank you!

PS: I now have some other problem with compiling the project, but that is not related to sbt-jooq, so I cannot tell for sure if it works, but it looks good so far :-)