Skip to content

Commit

Permalink
Merge pull request #1214 from guardian/play-3.0-upgrade
Browse files Browse the repository at this point in the history
Play 3.0 upgrade
  • Loading branch information
waisingyiu authored Apr 25, 2024
2 parents 495b002 + 9899f64 commit ae24708
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 23 deletions.
56 changes: 43 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ val compilerOptions = Seq(

ThisBuild / scalacOptions ++= compilerOptions

val playJsonVersion = "2.10.3"
val playJsonVersion = "3.0.2"
val specsVersion: String = "4.8.3"
val awsSdkVersion: String = "1.12.687"
val doobieVersion: String = "0.13.4"
Expand Down Expand Up @@ -59,7 +59,7 @@ lazy val commoneventconsumer = project
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % slf4jVersion,
"com.amazonaws" % "aws-java-sdk-athena" % awsSdkVersion,
"com.typesafe.play" %% "play-json" % playJsonVersion,
"org.playframework" %% "play-json" % playJsonVersion,
"org.specs2" %% "specs2-core" % specsVersion % "test",
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonDatabind,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % jacksonCbor,
Expand Down Expand Up @@ -88,8 +88,8 @@ lazy val common = project
ws,
"org.typelevel" %% "cats-core" % catsVersion,
"joda-time" % "joda-time" % "2.12.7",
"com.typesafe.play" %% "play-json" % playJsonVersion,
"com.typesafe.play" %% "play-json-joda" % playJsonVersion,
"org.playframework" %% "play-json" % playJsonVersion,
"org.playframework" %% "play-json-joda" % playJsonVersion,
"com.gu" %% "pa-client" % paClientVersion,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsSdkVersion,
"com.amazonaws" % "aws-java-sdk-cloudwatch" % awsSdkVersion,
Expand Down Expand Up @@ -154,6 +154,11 @@ lazy val registration = project
logback,
"org.tpolecat" %% "doobie-h2" % doobieVersion % Test
),
excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
Debian / packageName := name.value,
version := projectVersion
)
Expand All @@ -174,6 +179,11 @@ lazy val notification = project
logback,
"com.amazonaws" % "aws-java-sdk-sqs" % awsSdkVersion
),
excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
Debian / packageName := name.value,
version := projectVersion
)
Expand All @@ -193,6 +203,11 @@ lazy val report = project
libraryDependencies ++= Seq(
logback
),
excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
Debian / packageName := name.value,
version := projectVersion
)
Expand All @@ -204,7 +219,7 @@ lazy val apiModels = {
Project("api-models", file("api-models")).settings(Seq(
name := "mobile-notifications-api-models",
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-json" % playJsonVersion,
"org.playframework" %% "play-json" % playJsonVersion,
"org.specs2" %% "specs2-core" % specsVersion % "test",
"org.specs2" %% "specs2-mock" % specsVersion % "test",
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonDatabind,
Expand Down Expand Up @@ -295,7 +310,10 @@ lazy val schedulelambda = lambda("schedule", "schedulelambda")
"io.netty" % "netty-codec-http2" % nettyVersion
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.play", "play-ahc-ws_2.13")
ExclusionRule("org.playframework", "play-ahc-ws_2.13"),
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
)
}
Expand All @@ -319,8 +337,11 @@ lazy val football = lambda("football", "football")
"io.netty" % "netty-common" % nettyVersion,
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.play", "play-ahc-ws_2.13"),
ExclusionRule("software.amazon.awssdk", "ec2")
ExclusionRule("org.playframework", "play-ahc-ws_2.13"),
ExclusionRule("software.amazon.awssdk", "ec2"),
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
)

Expand All @@ -330,7 +351,7 @@ lazy val eventconsumer = lambda("eventconsumer", "eventconsumer", Some("com.gu.n
Seq(
description := "Consumes events produced when an app receives a notification",
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-json" % playJsonVersion,
"org.playframework" %% "play-json" % playJsonVersion,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsSdkVersion,
"org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2",
"io.netty" % "netty-codec-http2" % nettyVersion
Expand Down Expand Up @@ -417,11 +438,14 @@ lazy val notificationworkerlambda = lambda("notificationworkerlambda", "notifica
"com.amazonaws" % "aws-java-sdk-s3" % awsSdkVersion,
"com.amazonaws" % "amazon-sqs-java-messaging-lib" % "2.1.2",
"com.squareup.okhttp3" % "okhttp" % okHttpVersion,
"com.typesafe.play" %% "play-json" % playJsonVersion,
"org.playframework" %% "play-json" % playJsonVersion,
"com.google.oauth-client" % "google-oauth-client" % googleOAuthClient,
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.play", "play-ahc-ws_2.13")
ExclusionRule("org.playframework", "play-ahc-ws_2.13"),
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
)

Expand All @@ -433,14 +457,20 @@ lazy val fakebreakingnewslambda = lambda("fakebreakingnewslambda", "fakebreaking
"com.squareup.okhttp3" % "okhttp" % okHttpVersion,
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.play", "play-ahc-ws_2.13")
ExclusionRule("org.playframework", "play-ahc-ws_2.13"),
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
),
)

lazy val reportExtractor = lambda("reportextractor", "reportextractor", Some("com.gu.notifications.extractor.LocalRun"))
.dependsOn(common)
.settings(
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.play", "play-ahc-ws_2.13")
ExclusionRule("org.playframework", "play-ahc-ws_2.13"),
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
)
)
2 changes: 1 addition & 1 deletion common/src/main/scala/metrics/MetricActor.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package metrics

import akka.actor.Actor
import org.apache.pekko.actor.Actor
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient
import com.amazonaws.services.cloudwatch.model.{MetricDatum, PutMetricDataRequest, StandardUnit, StatisticSet}
import org.slf4j.{Logger, LoggerFactory}
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/metrics/Metrics.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package metrics

import akka.actor.{ActorSystem, Props}
import org.apache.pekko.actor.{ActorSystem, Props}
import com.amazonaws.regions.{Region, Regions}
import com.amazonaws.services.cloudwatch.{AmazonCloudWatch, AmazonCloudWatchClientBuilder}
import play.api.Environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package notification

import _root_.controllers.AssetsComponents
import _root_.models.{NewsstandShardConfig, TopicCount}
import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import aws.{AsyncDynamo, TopicCountsS3}
import com.amazonaws.regions.Regions.EU_WEST_1
import com.amazonaws.services.s3.{AmazonS3, AmazonS3ClientBuilder}
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ libraryDependencies ++= Seq(

resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.1")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package registration

import _root_.controllers.AssetsComponents
import _root_.models.NewsstandShardConfig
import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import cats.effect.IO
import com.gu.AppIdentity
import com.softwaremill.macwire._
Expand Down
8 changes: 4 additions & 4 deletions registration/app/registration/controllers/Main.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package registration.controllers

import akka.actor.ActorSystem
import akka.pattern.after
import akka.stream.scaladsl.Source
import akka.util.ByteString
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.pattern.after
import org.apache.pekko.stream.scaladsl.Source
import org.apache.pekko.util.ByteString
import cats.data.EitherT
import error.{NotificationsError, RequestError}
import models._
Expand Down
2 changes: 1 addition & 1 deletion report/app/report/ReportApplicationLoader.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package report

import _root_.controllers.AssetsComponents
import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import aws.AsyncDynamo
import com.amazonaws.regions.Regions.EU_WEST_1
import com.gu.AppIdentity
Expand Down

0 comments on commit ae24708

Please sign in to comment.