From 2bd167e9856812d01cd44e8a01190c5afb0b66bf Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sun, 26 Jan 2025 13:20:26 -0600 Subject: [PATCH] Add client starter module This adds a starter module that includes the Spring gRPC core module and the grpc-stub dependency. Also, makes the `grpc-stub` dependency optional in Spring gRPC core module. Signed-off-by: Chris Bono --- pom.xml | 1 + .../pom.xml | 42 +++++++++++++++++++ spring-grpc-core/pom.xml | 11 +++-- .../modules/ROOT/partials/_configprops.adoc | 4 +- spring-grpc-spring-boot-autoconfigure/pom.xml | 5 +++ spring-grpc-spring-boot-starter/pom.xml | 9 +++- 6 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 spring-grpc-client-spring-boot-starter/pom.xml diff --git a/pom.xml b/pom.xml index f0c41fb..ca3567c 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ spring-grpc-test spring-grpc-spring-boot-autoconfigure spring-grpc-spring-boot-starter + spring-grpc-client-spring-boot-starter samples diff --git a/spring-grpc-client-spring-boot-starter/pom.xml b/spring-grpc-client-spring-boot-starter/pom.xml new file mode 100644 index 0000000..81ff5d2 --- /dev/null +++ b/spring-grpc-client-spring-boot-starter/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.4.0-SNAPSHOT + + spring-grpc-client-spring-boot-starter + jar + Spring gRPC Client Spring Boot Starter + Spring gRPC Client Spring Boot Starter + + + + org.springframework.grpc + spring-grpc-core + ${project.version} + + + org.springframework.grpc + spring-grpc-spring-boot-autoconfigure + ${project.version} + + + io.grpc + grpc-netty + + + io.grpc + grpc-stub + + + org.springframework.boot + spring-boot-starter + ${spring-boot.version} + + + + diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml index c085fb6..ac9b2f9 100644 --- a/spring-grpc-core/pom.xml +++ b/spring-grpc-core/pom.xml @@ -35,6 +35,11 @@ io.grpc grpc-core + + + io.grpc + grpc-stub + true org.springframework.security @@ -88,12 +93,6 @@ com.google.api.grpc proto-google-common-protos - - - io.grpc - grpc-stub - - org.springframework.boot spring-boot-starter-test diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc index 5cdde9f..eb3824a 100644 --- a/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc @@ -40,12 +40,10 @@ |spring.grpc.server.observations.enabled | `+++true+++` | Whether to enable Observations on the server. |spring.grpc.server.port | `+++9090+++` | Server port to listen on. When the value is 0, a random available port is selected. The default is 9090. |spring.grpc.server.reflection.enabled | `+++true+++` | Whether to enable Reflection on the gRPC server. -|spring.grpc.server.security.csrf.enabled | `+++false+++` | Whether to enable CSRF protection on gRPC requests. -|spring.grpc.server.servlet.enabled | `+++true+++` | Whether to use a servlet server in a servlet-based web application (set to false to force a native gRPC server). |spring.grpc.server.shutdown-grace-period | `+++30s+++` | Maximum time to wait for the server to gracefully shutdown. When the value is negative, the server waits forever. When the value is 0, the server will force shutdown immediately. The default is 30 seconds. |spring.grpc.server.ssl.bundle | | SSL bundle name. |spring.grpc.server.ssl.client-auth | `+++none+++` | Client authentication mode. |spring.grpc.server.ssl.enabled | | Whether to enable SSL support. Enabled automatically if "bundle" is provided unless specified otherwise. |spring.grpc.server.ssl.secure | `+++true+++` | Flag to indicate that client authentication is secure (i.e. certificates are checked). Do not set this to false in production. -|=== \ No newline at end of file +|=== diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml index eb4c3f5..98566df 100644 --- a/spring-grpc-spring-boot-autoconfigure/pom.xml +++ b/spring-grpc-spring-boot-autoconfigure/pom.xml @@ -73,6 +73,11 @@ grpc-services true + + io.grpc + grpc-stub + true + io.grpc grpc-netty diff --git a/spring-grpc-spring-boot-starter/pom.xml b/spring-grpc-spring-boot-starter/pom.xml index d1b3297..5b174dc 100644 --- a/spring-grpc-spring-boot-starter/pom.xml +++ b/spring-grpc-spring-boot-starter/pom.xml @@ -10,8 +10,8 @@ spring-grpc-spring-boot-starter jar - Spring gRPC Spring Boot Starter - Spring gRPC Spring Boot Starter + Spring gRPC Server Spring Boot Starter + Spring gRPC Server Spring Boot Starter @@ -27,6 +27,11 @@ io.grpc grpc-netty + + + io.grpc + grpc-services + true org.springframework.boot