Skip to content

Commit

Permalink
build: Verify compilation JDK 21 (#3146)
Browse files Browse the repository at this point in the history
* build: Give the tests a run on JDK 21
* Accept warning in files connector
* opens for internal nio access in gcloud big query storage
* bumping cassandra docker image to 4.1 makes test pass locally
* Force bump bytebuddy to make mockito work
* bump arrow to make gcloud big query test pass
* give cassandra even more time
* Back to running tests on Java 11, leave compilation on 21
  • Loading branch information
johanandren committed Mar 28, 2024
1 parent df55d56 commit 94c99fd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d

- name: Set up JDK 11
- name: Set up JDK 21
# https://github.com/coursier/setup-action/releases
# v1.3.5
uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
with:
jvm: temurin:1.11
jvm: temurin:1.21

- name: "Code style, compile tests, MiMa. Run locally with: sbt \"verifyCodeStyle; +Test/compile; mimaReportBinaryIssues\""
run: sbt "verifyCodeStyle; +Test/compile; mimaReportBinaryIssues"
Expand Down
15 changes: 13 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@ lazy val elasticsearch = alpakkaProject(
)

// The name 'file' is taken by `sbt.file`, hence 'files'
lazy val files = alpakkaProject("file", "file", Dependencies.File, Scala3.settings)
lazy val files = alpakkaProject(
"file",
"file",
Dependencies.File,
Scala3.settings,
// com.sun.nio.file.SensitivityWatchEventModifier is deprecated in Java 21
// https://bugs.openjdk.org/browse/JDK-8303175
fatalWarnings := false
)

lazy val ftp = alpakkaProject(
"ftp",
Expand Down Expand Up @@ -212,7 +220,10 @@ lazy val googleCloudBigQueryStorage = alpakkaProject(
"-Wconf:src=.+/akka-grpc/main/.+:s",
"-Wconf:src=.+/akka-grpc/test/.+:s"
),
compile / javacOptions := (compile / javacOptions).value.filterNot(_ == "-Xlint:deprecation")
compile / javacOptions := (compile / javacOptions).value
.filterNot(_ == "-Xlint:deprecation"),
Test / fork := true,
Test / javaOptions += "--add-opens=java.base/java.nio=ALL-UNNAMED"
).dependsOn(googleCommon).enablePlugins(AkkaGrpcPlugin)

lazy val googleCloudPubSub = alpakkaProject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static <T> T await(CompletionStage<T> cs)
}

public static <T> T await(Future<T> future) {
int seconds = 25;
int seconds = 40;
try {
return Await.result(future, FiniteDuration.create(seconds, TimeUnit.SECONDS));
} catch (InterruptedException e) {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
ports:
- "5672:5672"
cassandra:
image: cassandra:4.0
image: cassandra:4.1
ports:
- "9042:9042"
couchbase:
Expand Down
8 changes: 2 additions & 6 deletions docs/src/main/paradox/google-cloud-bigquery-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,9 @@ The table below shows direct dependencies of this module and the second tab show

The Alpakka Google Cloud BigQuery Storage library contains the classes generated from [Google's protobuf specification](https://github.com/googleapis/java-bigquerystorage/tree/master/proto-google-cloud-bigquerystorage-v1).

@@@note { title="ALPN on JDK 8" }
@@@ note { title="Java 17" }

HTTP/2 requires ALPN negotiation, which comes with the JDK starting with
version 8u251.

For older versions of the JDK you will need to load the `jetty-alpn-agent`
yourself, but we recommend upgrading.
When running on Java 17 and newer you have to add JVM flag `--add-opens=java.base/java.nio=ALL-UNNAMED`.

@@@

Expand Down
10 changes: 0 additions & 10 deletions docs/src/main/paradox/google-cloud-pub-sub-grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ You can not use a different version of Akka gRPC within the same JVM instance.

The Alpakka Google Cloud Pub/Sub gRPC library contains the classes generated from [Google's protobuf specification](https://github.com/googleapis/java-pubsub/tree/master/proto-google-cloud-pubsub-v1/).

@@@note { title="ALPN on JDK 8" }

HTTP/2 requires ALPN negotiation, which comes with the JDK starting with
version 8u251.

For older versions of the JDK you will need to load the `jetty-alpn-agent`
yourself, but we recommend upgrading.

@@@

## Configuration

The Pub/Sub gRPC connector @ref[shares its basic configuration](google-common.md) with all the Google connectors in Alpakka.
Expand Down
10 changes: 7 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ object Dependencies {
)
)

val Mockito = Seq("org.mockito" % "mockito-core" % mockitoVersion % Test)
val Mockito = Seq(
"org.mockito" % "mockito-core" % mockitoVersion % Test,
// Force bump byte-buddy for JDK 21
"net.bytebuddy" % "byte-buddy" % "1.14.12" % Test
)

// Releases https://github.com/FasterXML/jackson-databind/releases
// CVE issues https://github.com/FasterXML/jackson-databind/issues?utf8=%E2%9C%93&q=+label%3ACVE
Expand Down Expand Up @@ -233,10 +237,10 @@ object Dependencies {
// https://github.com/googleapis/java-bigquerystorage/tree/master/proto-google-cloud-bigquerystorage-v1
"com.google.api.grpc" % "proto-google-cloud-bigquerystorage-v1" % "1.22.0" % "protobuf-src", // ApacheV2
"org.apache.avro" % "avro" % "1.11.3" % "provided",
"org.apache.arrow" % "arrow-vector" % "4.0.0" % "provided",
"org.apache.arrow" % "arrow-vector" % "13.0.0" % "provided",
"io.grpc" % "grpc-auth" % akka.grpc.gen.BuildInfo.grpcVersion, // ApacheV2
"com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion,
"org.apache.arrow" % "arrow-memory-netty" % "4.0.1" % Test,
"org.apache.arrow" % "arrow-memory-netty" % "13.0.0" % Test,
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion
) ++ Mockito
)
Expand Down

0 comments on commit 94c99fd

Please sign in to comment.