From 29910f9f1ace0bef27e2427c16b8262c4e7f5d9c Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sun, 20 Oct 2024 11:16:06 -0500 Subject: [PATCH 1/3] Clean up dependencies and versions This commit does the following: - Update various dependencies to latest patch versions - Remove unused dependencies - Remove unused version properties - Remove Spring Boot references in all modules except autoconfigure and samples --- pom.xml | 36 +++++++------ samples/grpc-server/build.gradle | 4 +- samples/grpc-server/pom.xml | 18 ++----- spring-grpc-core/pom.xml | 9 ++-- spring-grpc-docs/pom.xml | 11 ++-- spring-grpc-spring-boot-autoconfigure/pom.xml | 54 ++++++------------- spring-grpc-test/pom.xml | 14 +---- 7 files changed, 52 insertions(+), 94 deletions(-) diff --git a/pom.xml b/pom.xml index e81f4a03..3422ab58 100644 --- a/pom.xml +++ b/pom.xml @@ -74,20 +74,15 @@ 17 - 4.1.3 - 3.3.3 - 6.1.4 + 6.1.14 + 4.1.113.Final + 3.25.5 + 1.63.2 - - 3.25.2 - 1.63.0 - - - 5.3.1 - - - 1.20.1 - 2.0.1 + + 3.3.4 + 2.17.2 + 5.10.5 0.0.4 @@ -382,9 +377,16 @@ - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} + org.springframework + spring-framework-bom + ${spring-framework.version} + pom + import + + + io.netty + netty-bom + ${netty.version} pom import @@ -463,4 +465,4 @@ - \ No newline at end of file + diff --git a/samples/grpc-server/build.gradle b/samples/grpc-server/build.gradle index 14eed8d5..50870584 100644 --- a/samples/grpc-server/build.gradle +++ b/samples/grpc-server/build.gradle @@ -29,7 +29,7 @@ dependencyManagement { } dependencies { - implementation 'org.springframework.grpc:spring-grpc-spring-boot-autoconfigure:0.1.0-SNAPSHOT' + implementation 'org.springframework.grpc:spring-grpc-spring-boot-autoconfigure' implementation 'io.grpc:grpc-services' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.grpc:spring-grpc-test' @@ -55,4 +55,4 @@ protobuf { grpc {} } } -} \ No newline at end of file +} diff --git a/samples/grpc-server/pom.xml b/samples/grpc-server/pom.xml index 539b2939..38ab5ed6 100644 --- a/samples/grpc-server/pom.xml +++ b/samples/grpc-server/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.3 + 3.3.4 org.springframework.grpc @@ -30,22 +30,15 @@ 17 0.0.39 - 3.25.2 - 1.63.0 + 3.25.5 + 1.63.2 org.springframework.grpc spring-grpc-bom - 0.1.0-SNAPSHOT - pom - import - - - org.springframework.grpc - spring-grpc - 0.1.0-SNAPSHOT + ${project.version} pom import @@ -60,7 +53,6 @@ io.grpc grpc-services - org.springframework.boot spring-boot-starter-test @@ -185,4 +177,4 @@ - \ No newline at end of file + diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml index d68cd271..53debb17 100644 --- a/spring-grpc-core/pom.xml +++ b/spring-grpc-core/pom.xml @@ -21,7 +21,6 @@ - org.springframework spring-context @@ -54,14 +53,14 @@ 1.3.2 - - org.springframework.boot - spring-boot-starter-test + org.junit.jupiter + junit-jupiter + ${junit.version} test - \ No newline at end of file + diff --git a/spring-grpc-docs/pom.xml b/spring-grpc-docs/pom.xml index 1e2171f4..7cc9f34f 100644 --- a/spring-grpc-docs/pom.xml +++ b/spring-grpc-docs/pom.xml @@ -20,17 +20,14 @@ - org.springframework - spring-core + org.springframework.grpc + spring-grpc-spring-boot-autoconfigure + ${project.version} com.fasterxml.jackson.core jackson-databind - - - org.springframework.grpc - spring-grpc-spring-boot-autoconfigure - ${project.version} + ${jackson.version} diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml index b224b897..0f5ca762 100644 --- a/spring-grpc-spring-boot-autoconfigure/pom.xml +++ b/spring-grpc-spring-boot-autoconfigure/pom.xml @@ -20,79 +20,59 @@ git@github.com:spring-projects-experimental/spring-grpc.git - + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + org.springframework.boot spring-boot-configuration-processor true - - com.google.protobuf - protobuf-java - ${protobuf-java.version} - true - - - org.springframework.grpc spring-grpc-core ${project.parent.version} - org.springframework.boot spring-boot-starter - io.grpc grpc-netty-shaded true + + com.google.protobuf + protobuf-java + true + - org.springframework.grpc spring-grpc-test ${project.parent.version} test - org.springframework.boot spring-boot-starter-test test - - org.springframework.boot - spring-boot-testcontainers - test - - - - org.testcontainers - testcontainers - test - - - - org.awaitility - awaitility - test - - - - io.micrometer - micrometer-observation-test - test - - diff --git a/spring-grpc-test/pom.xml b/spring-grpc-test/pom.xml index c914b89d..2dc642b8 100644 --- a/spring-grpc-test/pom.xml +++ b/spring-grpc-test/pom.xml @@ -26,7 +26,6 @@ - org.springframework.grpc spring-grpc-core @@ -36,16 +35,5 @@ io.grpc grpc-testing - - - org.springframework.boot - spring-boot-starter-test - - - com.vaadin.external.google - android-json - - - - \ No newline at end of file + From b6b2fc37f97335e8cf00dc547056817253897d80 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sun, 20 Oct 2024 11:57:37 -0500 Subject: [PATCH 2/3] Remove dependency on javax.annotation This commit removes the directy dependency that was required by the protoc compiler for our samples. The Maven and Gradle now support an option to use an internal annotation which then allows us to remove the deprecated javax.annotation dependency. Background here: https://github.com/grpc/grpc-java/pull/10927 --- samples/grpc-server/build.gradle | 6 ++++-- samples/grpc-server/pom.xml | 19 ++++++++++++------- spring-grpc-core/pom.xml | 5 ----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/samples/grpc-server/build.gradle b/samples/grpc-server/build.gradle index 50870584..91d4fcea 100644 --- a/samples/grpc-server/build.gradle +++ b/samples/grpc-server/build.gradle @@ -52,7 +52,9 @@ protobuf { } generateProtoTasks { all()*.plugins { - grpc {} - } + grpc { + option 'jakarta_omit' + } + } } } diff --git a/samples/grpc-server/pom.xml b/samples/grpc-server/pom.xml index 38ab5ed6..1f51aadf 100644 --- a/samples/grpc-server/pom.xml +++ b/samples/grpc-server/pom.xml @@ -120,21 +120,26 @@ org.xolstice.maven.plugins protobuf-maven-plugin 0.6.1 + + + com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} + grpc-java + + io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + + + + jakarta_omit + + compile compile-custom - - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml index 53debb17..6b6f6641 100644 --- a/spring-grpc-core/pom.xml +++ b/spring-grpc-core/pom.xml @@ -47,11 +47,6 @@ io.grpc grpc-stub - - javax.annotation - javax.annotation-api - 1.3.2 - org.junit.jupiter From 195c610bdc5fd37f6ed24c2bddb37ea49c30b36a Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sun, 20 Oct 2024 12:17:56 -0500 Subject: [PATCH 3/3] Exclude older protofuf lib from grpc lib This commit excludes the older protobuf libs `protobuf-java` and `proto-google-common-protos` from the `grpc-protobuf` lib and then explicitly adds back in the dependencies at the desired version in the root pom.xml --- pom.xml | 8 +++++++- spring-grpc-core/pom.xml | 19 +++++++++++++++++++ spring-grpc-spring-boot-autoconfigure/pom.xml | 5 ----- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 3422ab58..32623aea 100644 --- a/pom.xml +++ b/pom.xml @@ -76,8 +76,9 @@ 6.1.14 4.1.113.Final - 3.25.5 1.63.2 + 3.25.5 + 2.46.0 3.3.4 @@ -404,6 +405,11 @@ pom import + + com.google.api.grpc + proto-google-common-protos + ${google-common-protos.version} + diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml index 6b6f6641..9cf5a9f0 100644 --- a/spring-grpc-core/pom.xml +++ b/spring-grpc-core/pom.xml @@ -42,7 +42,26 @@ io.grpc grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + io.grpc grpc-stub diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml index 0f5ca762..4bf1c0f2 100644 --- a/spring-grpc-spring-boot-autoconfigure/pom.xml +++ b/spring-grpc-spring-boot-autoconfigure/pom.xml @@ -54,11 +54,6 @@ grpc-netty-shaded true - - com.google.protobuf - protobuf-java - true -