From 98d744fd6b8e6d873f7b1d918b4e35c58abbf689 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Tue, 21 Jan 2025 16:26:44 -0600 Subject: [PATCH] Remove opinion on Netty from core module Currently the spring-grpc-core imposes an opinion on Netty. The core module should not have an opinion, but rather the starter enforces the opinion. Also, makes spring-grpc-core optional in the autconfigure module as the autoconfigure will eventually be moved into Spring Boot and at that time everything is optional. Signed-off-by: Chris Bono --- samples/grpc-server-netty-shaded/build.gradle | 9 +++------ spring-grpc-core/pom.xml | 1 + spring-grpc-spring-boot-autoconfigure/pom.xml | 6 ++++++ spring-grpc-spring-boot-starter/pom.xml | 4 ++++ spring-grpc-test/pom.xml | 10 ++++++++++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/samples/grpc-server-netty-shaded/build.gradle b/samples/grpc-server-netty-shaded/build.gradle index 1c3cbf7..54a3823 100644 --- a/samples/grpc-server-netty-shaded/build.gradle +++ b/samples/grpc-server-netty-shaded/build.gradle @@ -29,14 +29,11 @@ dependencyManagement { } dependencies { - implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter' + implementation ('org.springframework.grpc:spring-grpc-spring-boot-starter') { + exclude group: "io.grpc", module: "grpc-netty" + } implementation 'io.grpc:grpc-netty-shaded' implementation 'io.grpc:grpc-services' - modules { - module("io.grpc:grpc-netty") { - replacedBy("io.grpc:grpc-netty-shaded", "Use Netty shaded instead of regular Netty") - } - } testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.grpc:spring-grpc-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml index 88c6fde..c085fb6 100644 --- a/spring-grpc-core/pom.xml +++ b/spring-grpc-core/pom.xml @@ -54,6 +54,7 @@ io.grpc grpc-netty + true io.grpc diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml index 96c2fca..eb4c3f5 100644 --- a/spring-grpc-spring-boot-autoconfigure/pom.xml +++ b/spring-grpc-spring-boot-autoconfigure/pom.xml @@ -51,6 +51,7 @@ org.springframework.grpc spring-grpc-core ${project.version} + true org.springframework @@ -72,6 +73,11 @@ grpc-services true + + io.grpc + grpc-netty + true + io.grpc grpc-netty-shaded diff --git a/spring-grpc-spring-boot-starter/pom.xml b/spring-grpc-spring-boot-starter/pom.xml index 42b5ff9..d1b3297 100644 --- a/spring-grpc-spring-boot-starter/pom.xml +++ b/spring-grpc-spring-boot-starter/pom.xml @@ -24,6 +24,10 @@ spring-grpc-spring-boot-autoconfigure ${project.version} + + io.grpc + grpc-netty + org.springframework.boot spring-boot-starter diff --git a/spring-grpc-test/pom.xml b/spring-grpc-test/pom.xml index 428523a..02f218c 100644 --- a/spring-grpc-test/pom.xml +++ b/spring-grpc-test/pom.xml @@ -25,6 +25,11 @@ + + org.springframework.grpc + spring-grpc-core + ${project.version} + org.springframework.grpc spring-grpc-spring-boot-autoconfigure @@ -39,6 +44,11 @@ io.grpc grpc-testing + + io.grpc + grpc-netty + true + io.grpc grpc-inprocess