Skip to content

Commit

Permalink
chore: Drop JDK 8
Browse files Browse the repository at this point in the history
* doc references to jdk 8
  • Loading branch information
patriknw committed Sep 28, 2023
1 parent a3a71fa commit 8ce1d6e
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
matrix:
include:
# leaving out combinations covered in `build-test.yml`
- { scalaVersion: "2.13", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' }
# { scalaVersion: "2.13", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { scalaVersion: "2.13", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }

- { scalaVersion: "3.3", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' }
# { scalaVersion: "3.3", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { scalaVersion: "3.3", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }
steps:
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Pull Request validation states:

gRPC runs on HTTP/2 and connections commonly use HTTPS.

If you are running on JDK 8, you will need to use at least version 1.8.0u251 to make sure ALPN protocol negotiation is available.

# Akka gRPC contributing guidelines

These guidelines apply to all Akka projects, by which we mean both the `akka/akka` repository,
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ project in Java and Scala respectively, with both sbt and Gradle configurations.

## Compatibility & support

If used with JDK 8 prior to version 1.8.0_251 you must add an [ALPN agent](https://doc.akka.io/docs/akka-http/10.1/server-side/http2.html#application-layer-protocol-negotiation-alpn-).

Support for Akka gRPC is available via the [Lightbend Subscription](https://lightbend.com/lightbend-subscription)

## License
Expand Down
4 changes: 0 additions & 4 deletions docs/src/main/paradox/buildtools/gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ explicit by duplicating the proto definitions in your project.

This is supported by `protobuf-gradle-plugin` and explained [here](https://github.com/google/protobuf-gradle-plugin#protos-in-dependencies).

## JDK 8 support

If you want to use TLS-based negotiation on JDK 8, Akka gRPC requires JDK 8 update 252 or later. JVM support for ALPN has been backported to JDK 8u252 which is now widely available. Support for using the Jetty ALPN agent has been [dropped in Akka HTTP 10.2.0](https://doc.akka.io/docs/akka-http/current/migration-guide/migration-guide-10.2.x.html#http-2-support-requires-jdk-8-update-252-or-later), and therefore is not supported by Akka gRPC.

## Starting your Akka gRPC server from gradle

Build script needs a custom task
Expand Down
4 changes: 0 additions & 4 deletions docs/src/main/paradox/buildtools/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ Finally, the `target/proto` directory has to be introduced to the `akka-grpc-mav
Java
: @@snip[unpack protos](/plugin-tester-java/pom.xml) { #all-proto-paths }

## JDK 8 support

If you want to use TLS-based negotiation on JDK 8, Akka gRPC requires JDK 8 update 252 or later. JVM support for ALPN has been backported to JDK 8u252 which is now widely available. Support for using the Jetty ALPN agent has been [dropped in Akka HTTP 10.2.0](https://doc.akka.io/docs/akka-http/current/migration-guide/migration-guide-10.2.x.html#http-2-support-requires-jdk-8-update-252-or-later), and therefore is not supported by Akka gRPC.

## Starting your Akka gRPC server from Maven

You can start your gRPC application as usual with:
Expand Down
4 changes: 0 additions & 4 deletions docs/src/main/paradox/buildtools/sbt.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ as an external protobuf source, add it like:
libraryDependencies += "com.example" %% "my-grpc-service" % "1.0.0" % "protobuf"
```

## JDK 8 support

If you want to use TLS-based negotiation on JDK 8, Akka gRPC requires JDK 8 update 252 or later. JVM support for ALPN has been backported to JDK 8u252 which is now widely available. Support for using the Jetty ALPN agent has been [dropped in Akka HTTP 10.2.0](https://doc.akka.io/docs/akka-http/current/migration-guide/migration-guide-10.2.x.html#http-2-support-requires-jdk-8-update-252-or-later), and therefore is not supported by Akka gRPC.

## Starting your Akka gRPC server from sbt

You can start your gRPC application as usual with:
Expand Down
2 changes: 0 additions & 2 deletions docs/src/main/paradox/client/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Maven
<artifactId>my-grpc-app</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<akka.grpc.version>$project.version$</akka.grpc.version>
<grpc.version>$grpc.version$</grpc.version>
<project.encoding>UTF-8</project.encoding>
Expand Down
2 changes: 0 additions & 2 deletions docs/src/main/paradox/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Remember that the cleartext HTTP/2 "h2c with prior knowledge" protocol is not co

To deploy your gRPC service over a HTTPS connection you will have to use an @apidoc[akka.http.(javadsl|scaladsl).HttpsConnectionContext] as described in the [Akka-HTTP documentation](https://doc.akka.io/docs/akka-http/10.1/server-side/server-https-support.html).

When using HTTPS and running your application on a JDK 8 prior to version 1.8.0_251 you also need to provide an external ALPN implementation. Follow the [section on ALPN](https://doc.akka.io/docs/akka-http/10.1/server-side/http2.html#application-layer-protocol-negotiation-alpn-) in the Akka-HTTP docs for more details.

## Example: Kubernetes

As an example, [here](https://developer.lightbend.com/start/?group=akka&project=akka-grpc-sample-kubernetes-scala) is a complete project consisting of two applications (a gRPC service and an HTTP service that consumes the gRPC service) that can be deployed together in Kubernetes.
5 changes: 0 additions & 5 deletions docs/src/main/paradox/server/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ Maven
<artifactId>my-grpc-app</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<akka.grpc.version>$project.version$</akka.grpc.version>
<grpc.version>$grpc.version$</grpc.version>
<project.encoding>UTF-8</project.encoding>
Expand Down Expand Up @@ -221,9 +219,6 @@ methods to create partial functions that are combined by `concatOrNotFound`.]

## Running the server

To run the server with HTTP/2 using HTTPS on a JVM prior to version 1.8.0_251, you will likely have to configure the Jetty ALPN
agent as described [in the Akka HTTP documentation](https://doc.akka.io/docs/akka-http/10.1/server-side/http2.html#application-layer-protocol-negotiation-alpn-). Later JVM versions have this support built-in.

See the detailed chapters on @ref[sbt](../buildtools/sbt.md#starting-your-akka-grpc-server-from-sbt), @ref[Gradle](../buildtools/gradle.md#starting-your-akka-grpc-server-from-gradle)
and @ref[Maven](../buildtools/maven.md#starting-your-akka-grpc-server-from-maven) for details on adding the agent.

Expand Down
11 changes: 9 additions & 2 deletions plugin-tester-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<version>0.1-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
<maven-exec-plugin.version>3.0.0</maven-exec-plugin.version>
<akka.http.cors.version>1.1.0</akka.http.cors.version>
Expand Down Expand Up @@ -50,6 +49,14 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
12 changes: 10 additions & 2 deletions plugin-tester-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<version>0.1-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<akka.version>2.7.0</akka.version>
<akka.http.cors.version>0.4.2</akka.http.cors.version>
<grpc.version>1.54.2</grpc.version> <!-- checked synced by VersionSyncCheckPlugin -->
Expand Down Expand Up @@ -67,6 +66,15 @@
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
Expand Down
15 changes: 8 additions & 7 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object Common extends AutoPlugin {
sonatypeProfileName := "com.lightbend",
scalacOptions ++= Seq(
"-release",
"8",
"11",
"-unchecked",
"-deprecation",
"-language:_",
Expand Down Expand Up @@ -84,10 +84,7 @@ object Common extends AutoPlugin {
Seq.empty
}),
Compile / console / scalacOptions ~= (_.filterNot(consoleDisabledOptions.contains)),
javacOptions ++= (
if (isJdk8) Seq("-Xlint:unchecked", "-Xlint:deprecation")
else Seq("-Xlint:unchecked", "-Xlint:deprecation", "--release", "8")
),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation", "--release", "11"),
Compile / doc / scalacOptions :=
scalacOptions.value ++
Seq(
Expand Down Expand Up @@ -120,6 +117,10 @@ object Common extends AutoPlugin {
mimaReportSignatureProblems := true,
scalafmtOnCompile := true)

private def isJdk8 =
VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(s"=1.8"))
val isJdk11orHigher: Boolean = {
val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11"))
if (!result)
throw new IllegalArgumentException("JDK 11 or higher is required")
result
}
}
2 changes: 1 addition & 1 deletion project/project-info.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project-info {
version: "current"
shared-info {
jdk-versions: ["Adopt OpenJDK 8", "Adopt OpenJDK 11"]
jdk-versions: ["Eclipse Temurin JDK 11", "Eclipse Temurin JDK 17"]
snapshots: {
url: "https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/grpc/"
text: "Snapshots are available from Sonatype"
Expand Down

0 comments on commit 8ce1d6e

Please sign in to comment.