Skip to content

Commit 85d7688

Browse files
committed
Use 'release' setting instead of 'compatibility' setting for compileJettyTestJava because of certain methods not found in Deprecated class with source compatibility specified at 1.8 https://github.com/grpc/grpc-java/actions/runs/13155287866/job/36710941635
1 parent 4801e34 commit 85d7688

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ guava-jre = "com.google.guava:guava:33.3.1-jre"
5353
hdrhistogram = "org.hdrhistogram:HdrHistogram:2.2.2"
5454
# 6.0.0+ use java.lang.Deprecated forRemoval and since from Java 9
5555
jakarta-servlet-api = "jakarta.servlet:jakarta.servlet-api:5.0.0"
56-
# Not using the relocated org.apache.tomcat:tomcat-annotations-api because it requires migrating
57-
# java.annotation to jakarta.annotation. According to
58-
# https://github.com/grpc/grpc-java/issues/6833#issuecomment-602242609
59-
# there are so many different artifacts containing it, which causes classpath collisions.
56+
# Using javax.annotation is fine as it is part of the JDK, we don't want to depend on J2EE
57+
# where it is relocated to as org.apache.tomcat:tomcat-annotations-api. See issue #7179.
6058
javax-annotation = "org.apache.tomcat:annotations-api:6.0.53"
6159
javax-servlet-api = "javax.servlet:javax.servlet-api:4.0.1"
6260
# 12.0.0+ require Java 17+

servlet/jakarta/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ configurations {
3737
undertowTestImplementation.extendsFrom(itImplementation)
3838
}
3939

40-
java {
41-
sourceCompatibility = JavaVersion.VERSION_1_8
42-
targetCompatibility = JavaVersion.VERSION_1_8
43-
}
44-
4540
// Mechanically transform sources from grpc-servlet to use the corrected packages
4641
def migrate(String name, String inputDir, SourceSet sourceSet) {
4742
def outputDir = layout.buildDirectory.dir('generated/sources/jakarta-' + name)
@@ -115,6 +110,9 @@ if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
115110
classpath = sourceSets.jettyTest.runtimeClasspath
116111
testClassesDirs = sourceSets.jettyTest.output.classesDirs
117112
}
113+
tasks.named('compileJettyTestJava') { JavaCompile task ->
114+
task.options.release.set 8
115+
}
118116
tasks.named("check").configure {
119117
dependsOn jetty11Test
120118
}

0 commit comments

Comments
 (0)