Skip to content

Commit

Permalink
Fix various sbt errors & problems
Browse files Browse the repository at this point in the history
* Update `sbt-riffraff-artifact` plugin to v1.1.18 to fix the noisy AWS
  SDK "Unable to retrieve the requested metadata" error that occurs on
  starting sbt - see guardian/sbt-riffraff-artifact#68 .
  Without the fix, we see a big noisy non-fatal error like this:
  https://gist.github.com/rtyley/13dae25b0531cd644c36626d36d4aa6a
* Remove the `-XX:+CMSClassUnloadingEnabled` flag from `.sbtopts`. This
  option is enabled by default in Java 8 onwards (so there's no point
  in setting it!)
  https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#:~:text=%2DXX%3A%2B-,CMSClassUnloadingEnabled,-Enables%20class%20unloading
  https://stackoverflow.com/q/3334911/438886
* Remove the obsolete and broken https://repo.typesafe.com/ resolver
  https://discuss.lightbend.com/t/typesaferepo-https-repo-typesafe-com-typesafe-releases-is-returning-a-404-error/8156
* Remove the superfluous `sbt-coursier` plugin - since sbt 1.3 and above
  ships with coursier support out-of-the-box (https://get-coursier.io/docs/sbt-coursier),
  additionally installing the `sbt-coursier` just causes this error:
  `sbt.internal.IncompatiblePluginsException: Binary incompatibility in plugins detected.`
  https://gist.github.com/rtyley/46a88f5e0b2ababb243695b4cd155aaa
* Tweak `scala-xml` library scheme declaration (to make it more compact)
  and associated comment (fixing inverted statement)
  • Loading branch information
rtyley committed Jan 31, 2024
1 parent 1e9b727 commit c053d47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
1 change: 0 additions & 1 deletion .sbtopts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-J-Xms512M
-J-Xmx1536M
-J-Xss4M
-J-XX:+CMSClassUnloadingEnabled
-J-Dhttp.port=9001
22 changes: 7 additions & 15 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
// The Typesafe repository
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/maven-releases/"

// a, faster, alternative dependancy resolver to ivy
// https://github.com/coursier/coursier#sbt-plugin
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC12")

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.4")

addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2")

addSbtPlugin("com.gu" % "sbt-riffraff-artifact" % "1.1.17")
addSbtPlugin("com.gu" % "sbt-riffraff-artifact" % "1.1.18")

// for creating test cases that use a local dynamodb

Expand All @@ -26,12 +19,11 @@ libraryDependencies += "org.vafer" % "jdeb" % "1.6" artifacts (Artifact("jdeb",
addDependencyTreePlugin

/*
Because scala-xml has not be updated to 2.x in sbt yet but has in sbt-native-packager
scala-xml has been updated to 2.x in sbt, but not in other sbt plugins like sbt-native-packager
See: https://github.com/scala/bug/issues/12632
This effectively overrides the safeguards (early-semver) put in place by the library authors ensuring binary compatibility.
We consider this a safe operation because it only affects the compilation of build.sbt, not of the application build itself
This is effectively overrides the safeguards (early-semver) put in place by the library authors ensuring binary compatibility.
We consider this a safe operation because when set under `projects/` (ie *not* in `build.sbt` itself) it only affects the
compilation of build.sbt, not of the application build itself.
Once the build has succeeded, there is no further risk (ie of a runtime exception due to clashing versions of `scala-xml`).
*/
libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

0 comments on commit c053d47

Please sign in to comment.