diff --git a/.java-version b/.java-version deleted file mode 100644 index 3a560a7e..00000000 --- a/.java-version +++ /dev/null @@ -1 +0,0 @@ -11.0.20 diff --git a/.tool-versions b/.tool-versions index 58dcdfd2..0ef52de3 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -java corretto-11.0.25.9.1 +java corretto-21 diff --git a/README.md b/README.md index c93f44b9..22107d80 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Running locally ------------------------------ 1. Get Deploy Tools Janus credentials. 2. Run `./scripts/setup` -3. Ensure you are running Java 11 +3. Ensure you are running Java 21 4. Run `sbt` 5. Start the application: `sbt:prism> run` diff --git a/app/agent/origin.scala b/app/agent/origin.scala index d6bea311..7c169e72 100644 --- a/app/agent/origin.scala +++ b/app/agent/origin.scala @@ -1,7 +1,7 @@ package agent import java.io.FileNotFoundException -import java.net.{URI, URL, URLConnection, URLStreamHandler} +import java.net.URI import collectors.Instance import conf.{AWS, PrismConfiguration} @@ -206,17 +206,6 @@ case class JsonOrigin( crawlRate: Map[String, CrawlRate] ) extends Origin with Logging { - private val classpathHandler = new URLStreamHandler { - override def openConnection(u: URL): URLConnection = { - Option(getClass.getResource(u.getPath)) - .map(_.openConnection()) - .getOrElse { - throw new FileNotFoundException( - "%s not found on classpath" format u.getPath - ) - } - } - } def credsFromS3Url(url: URI): AwsCredentialsProvider = { Option(url.getUserInfo) match { @@ -237,10 +226,11 @@ case class JsonOrigin( url.replace("%resource%", resource.name) ) match { case classPathLocation if classPathLocation.getScheme == "classpath" => - Source.fromURL( - new URL(null, classPathLocation.toString, classpathHandler), - "utf-8" - ) + val path = classPathLocation.getPath + val resourceURL = Option(getClass.getResource(path)).getOrElse { + throw new FileNotFoundException(s"$path not found on classpath") + } + Source.fromURL(resourceURL, "utf-8") case s3Location if s3Location.getScheme == "s3" => val s3Client = S3Client.builder .credentialsProvider(credsFromS3Url(s3Location)) diff --git a/cdk/lib/prism.ts b/cdk/lib/prism.ts index f18d3dc8..49ee1da1 100644 --- a/cdk/lib/prism.ts +++ b/cdk/lib/prism.ts @@ -89,7 +89,7 @@ export class Prism extends GuStack { applicationLogging: { enabled: true, }, - imageRecipe: 'arm64-focal-java11-deploy-infrastructure', + imageRecipe: 'arm64-jammy-java21-deploy-infrastructure', instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MEDIUM), userData, certificateProps: {