Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version upgrades #11874

Merged
merged 23 commits into from
Feb 11, 2025
Merged

Version upgrades #11874

merged 23 commits into from
Feb 11, 2025

Conversation

kannanjgithub
Copy link
Contributor

No description provided.

kannanjgithub and others added 11 commits January 16, 2025 18:14
…o org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.16org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.16 is causing JakartaInteropTests to fail, that needs work.
…vlet-api upgrade, not jetty, reverted jakarta-servlet-api back to 5.0.0 from 6.1.0 for Java 11 unsupported.
…notations:2.36.0 is coming via it.

|    |    |    +--- com.google.auth:google-auth-library-oauth2-http:1.30.1
|    |    |    |    +--- com.google.auto.value:auto-value-annotations:1.11.0
|    |    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
|    |    |    |    +--- com.google.auth:google-auth-library-credentials:1.30.1
|    |    |    |    +--- com.google.http-client:google-http-client:1.45.2
|    |    |    |    |    +--- org.apache.httpcomponents:httpclient:4.5.14
|    |    |    |    |    |    +--- org.apache.httpcomponents:httpcore:4.4.16
|    |    |    |    |    |    \--- commons-codec:commons-codec:1.11
|    |    |    |    |    +--- org.apache.httpcomponents:httpcore:4.4.16
|    |    |    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
|    |    |    |    |    +--- com.google.errorprone:error_prone_annotations:2.36.0
@kannanjgithub kannanjgithub requested a review from ejona86 February 4, 2025 06:42
# JRE version is needed for projects where its a transitive dependency, f.e. gcp-observability.
# May be different from the -android version.
guava-jre = "com.google.guava:guava:33.3.1-jre"
hdrhistogram = "org.hdrhistogram:HdrHistogram:2.2.2"
# 6.0.0+ use java.lang.Deprecated forRemoval and since from Java 9
jakarta-servlet-api = "jakarta.servlet:jakarta.servlet-api:5.0.0"
# Not using the relocated org.apache.tomcat:tomcat-annotations-api because it requires migrating
# java.annotation to jakarta.annotation. According to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#9179 is a better reference. Basically, javax.annotation.Generated was fine because it was part of the JDK. And then it moved out of the JDK and then it was renamed. We have no desire to depend on J2EE for this.

There's also #11086 which lets you turn off the annotation.

gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Show resolved Hide resolved
@kannanjgithub
Copy link
Contributor Author

Getting these warning as errors in Jakarta servlet project compilation. It is showing warnings in the dependency classes. Any idea how to suppress them?

@ejona86
Copy link
Member

ejona86 commented Feb 5, 2025

The warnings are probably because of:

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

But we need that. You want just the test to use a newer version of Java during compilation, so you'll want to change the configuration of the compileJettyTestJava task. You'll probably need to use the 'release' setting instead of 'compatibility' setting, like we do elsewhere:

tasks.withType(JavaCompile).configureEach {

…ettyTestJava 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
@kannanjgithub
Copy link
Contributor Author

The warnings are probably because of:

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

But we need that. You want just the test to use a newer version of Java during compilation, so you'll want to change the configuration of the compileJettyTestJava task. You'll probably need to use the 'release' setting instead of 'compatibility' setting, like we do elsewhere:

tasks.withType(JavaCompile).configureEach {

I tried that

tasks.named('compileJettyTestJava') { JavaCompile task ->
        task.options.release.set 8
    }

and removed

sourceCompatibility = JavaVersion.VERSION_1_8 
 targetCompatibility = JavaVersion.VERSION_1_8 

But it still fails with the same error.

@kannanjgithub
Copy link
Contributor Author

The warnings are probably because of:

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

But we need that. You want just the test to use a newer version of Java during compilation, so you'll want to change the configuration of the compileJettyTestJava task. You'll probably need to use the 'release' setting instead of 'compatibility' setting, like we do elsewhere:

tasks.withType(JavaCompile).configureEach {

Figured that we should use Java 9 for release compatibility because the forRelease() in Deprecated was introduced then.

servlet/jakarta/build.gradle Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
…ing:mergeDexDebug task is failing with

> Could not resolve all files for configuration ':grpc-android-interop-testing:debugRuntimeClasspath'.
   > Failed to transform annotation-jvm-1.9.1.jar (androidx.annotation:annotation-jvm:1.9.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=20, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingWithClasspathTransform: /root/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.9.1/b17951747e38bf3986a24431b9ba0d039958aa5f/annotation-jvm-1.9.1.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.24.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.24) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=20, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.24/9928532f12c66ad816a625b3f9984f8368ca6d2b/kotlin-stdlib-1.9.24.jar.
         > Error while dexing.
…ing:mergeDexDebug task is failing with

> Could not resolve all files for configuration ':grpc-android-interop-testing:debugRuntimeClasspath'.
   > Failed to transform annotation-jvm-1.9.1.jar (androidx.annotation:annotation-jvm:1.9.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=20, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingWithClasspathTransform: /root/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.9.1/b17951747e38bf3986a24431b9ba0d039958aa5f/annotation-jvm-1.9.1.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.24.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.24) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=20, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.24/9928532f12c66ad816a625b3f9984f8368ca6d2b/kotlin-stdlib-1.9.24.jar.
         > Error while dexing.
@kannanjgithub kannanjgithub merged commit fc8571a into grpc:master Feb 11, 2025
16 checks passed
@kannanjgithub kannanjgithub deleted the versionupgrade branch February 11, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants