From 770bfb17f8147b7599a593d9a77c7f4d58b559b4 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 7 Aug 2024 10:42:58 +0100 Subject: [PATCH] Try updating sbt and scala to fix Scala Steward MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scala Steward [requires higher minimum versions of sbt and scala than this repository is using](https://github.com/guardian/maintaining-scala-projects/issues/7), and I think this is why it [recently broke on this repository](https://github.com/guardian/scala-steward-public-repos/actions/runs/10265200458/job/28400891950). In this commit I’ve attempted to update to newer scala and sbt versions in the hope that it would be a straightforward update. Unfortunately there’s a clash, as a number of dependencies now depend on org.scala-lang.modules:scala-xml at incompatible versions with the compiler’s dependency. (I.e. the compiler depends on org.scala-lang.modules:scala-xml_2.12:2.2.0, but some dependencies here depend on org.scala-lang.modules:scala-xml_2.12:1.x.) This is the initial sbt output when you update scala and sbt: > * org.scala-lang.modules:scala-xml_2.12:2.2.0 (early-semver) is selected over {1.3.0, 1.0.6} > +- org.scala-lang:scala-compiler:2.12.19 (depends on 2.2.0) > +- org.scalaz:scalaz-core_2.12:7.1.17 (depends on 1.0.6) > +- org.scalatra:scalatra_2.12:2.6.3 (depends on 1.0.6) > +- org.json4s:json4s-core_2.12:3.5.2 (depends on 1.0.6) > +- net.liftweb:lift-json_2.12:3.5.0 (depends on 1.3.0) Unfortunately, the newest full release of scalatra_2.12 on maven central is 2.8.4, which still depends on v1 of scala-xml. Also, that lift-json dependency is a transitive dependency of com.gu.identity:identity-crypto and others. --- api/build.sbt | 6 +++--- api/project/build.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/build.sbt b/api/build.sbt index d82ae60..23d0bf6 100644 --- a/api/build.sbt +++ b/api/build.sbt @@ -10,15 +10,15 @@ enablePlugins( organization := "com.gu" name := "avatar-api" version := "1.0" -scalaVersion := "2.12.8" +scalaVersion := "2.12.19" -val ScalatraVersion = "2.6.3" +val ScalatraVersion = "2.8.4" val jettyVersion = "9.4.53.v20231009" val json4sVersion = "3.5.2" val logbackVersion = "1.2.13" val logstashEncoderVersion = "7.3" val servletApiVersion = "3.1.0" -val scalazVersion = "7.1.17" +val scalazVersion = "7.3.8" val identityVersion = "4.31" val typesafeConfigVersion = "1.2.1" val amazonawsVersion = "1.12.668" diff --git a/api/project/build.properties b/api/project/build.properties index 72413de..ee4c672 100644 --- a/api/project/build.properties +++ b/api/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.3 +sbt.version=1.10.1