Skip to content

Commit 959323b

Browse files
authored
Add build support for Java 11
It appears everything was already working on Java 11, except build-specific and testing issues. Updating to Netty 4.1.30 (grpc#4940) probably fixed the last true Java 11 incompatibility. Fixes grpc#4933
1 parent f7dec06 commit 959323b

File tree

8 files changed

+23
-3
lines changed

8 files changed

+23
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jdk:
4949
# processor based plugin.
5050
- oraclejdk8 # if both jdk 8 and 9 are removed, migrate to net.ltgt.errorprone-javacplugin (see above comment)
5151
- oraclejdk9 # if both jdk 8 and 9 are removed, migrate to net.ltgt.errorprone-javacplugin (see above comment)
52+
- openjdk11
5253

5354
notifications:
5455
email: false

alts/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
// prefer 20.0 from libraries instead of 19.0
3333
exclude group: 'com.google.guava', module: 'guava'
3434
}
35+
compileOnly libraries.javax_annotation
3536
runtime project(':grpc-grpclb')
3637
testCompile libraries.guava,
3738
libraries.guava_testlib,

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ subprojects {
297297
}
298298
}
299299

300+
jacoco {
301+
toolVersion = "0.8.2"
302+
}
303+
300304
checkstyle {
301305
configDir = file("$rootDir/buildscripts")
302306
toolVersion = "6.17"

compiler/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,14 @@ configurations {
130130

131131
dependencies {
132132
testCompile project(':grpc-protobuf'),
133-
project(':grpc-stub')
133+
project(':grpc-stub'),
134+
libraries.javax_annotation
134135
testLiteCompile project(':grpc-protobuf-lite'),
135-
project(':grpc-stub')
136+
project(':grpc-stub'),
137+
libraries.javax_annotation
136138
testNanoCompile project(':grpc-protobuf-nano'),
137-
project(':grpc-stub')
139+
project(':grpc-stub'),
140+
libraries.javax_annotation
138141
}
139142

140143
sourceSets {

examples/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ repositories {
1717
mavenLocal()
1818
}
1919

20+
sourceCompatibility = 1.7
21+
targetCompatibility = 1.7
22+
2023
// IMPORTANT: You probably want the non-SNAPSHOT version of gRPC. Make sure you
2124
// are looking at a tagged version of the example and not "master"!
2225

examples/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
<artifactId>grpc-alts</artifactId>
4141
<version>${grpc.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>javax.annotation</groupId>
45+
<artifactId>javax.annotation-api</artifactId>
46+
<version>1.2</version>
47+
<scope>provided</scope> <!-- not needed at runtime -->
48+
</dependency>
4349
<dependency>
4450
<groupId>io.grpc</groupId>
4551
<artifactId>grpc-testing</artifactId>

netty/src/test/java/io/grpc/netty/ProtocolNegotiatorsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void setUp() throws Exception {
9696
sslContext = GrpcSslContexts.forServer(serverCert, key)
9797
.ciphers(TestUtils.preferredTestCiphers(), SupportedCipherSuiteFilter.INSTANCE).build();
9898
engine = SSLContext.getDefault().createSSLEngine();
99+
engine.setUseClientMode(true);
99100
}
100101

101102
@Test

services/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies {
2121
compileOnly libraries.javax_annotation
2222
testCompile project(':grpc-testing'),
2323
libraries.netty_epoll // for DomainSocketAddress
24+
testCompileOnly libraries.javax_annotation
2425
signature "org.codehaus.mojo.signature:java17:1.0@signature"
2526
}
2627

0 commit comments

Comments
 (0)