From f0a84cec5d68a3e303c28043d3d07e7b320fe917 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 16 Oct 2024 13:02:45 +0100 Subject: [PATCH] Sack the flatten plugin, at least till it works --- README.md | 47 ++++++++++++++++++++++--------------- pom.xml | 34 --------------------------- samples/grpc-server/pom.xml | 45 +++++++++++++++++++++++++++++++++++ spring-grpc-bom/pom.xml | 38 ------------------------------ 4 files changed, 73 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index 5f06e29..48d7e19 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,34 @@ or for Gradle: implementation 'org.springframework.grpc:spring-grpc-spring-boot-autoconfigure:0.1.0-SNAPSHOT' ``` +For convenience, you can use the Spring gRPC BOM to manage dependencies. With Maven: + +```xml + + + + org.springframework.grpc + spring-grpc-bom + 0.1.0-SNAPSHOT + pom + import + + + +``` + +or Gradle: + +```groovy +dependencyManagement { + imports { + mavenBom 'org.springframework.grpc:spring-grpc-bom:0.1.0-SNAPSHOT' + } +} +``` + +Then you can omit the version from the dependencies. + You need a Protobuf file that defines your service and messages, and you will need to configure your build tools to compile it into Java sources. This is a standard part of gRPC development (i.e. nothing to do with Spring). We now come to the Spring gRPC features. ### gPRC Server @@ -54,25 +82,6 @@ public class GrpcServerApplication { Run it from your IDE, or on the command line with `mvn spring-boot:run` or `gradle bootRun`. -For convenience, you can use the Spring gRPC BOM to manage dependencies: - -```xml - - - - org.springframework.grpc - spring-grpc-bom - 0.1.0-SNAPSHOT - pom - import - - - -``` - -Then you can omit the version from the dependencies: - - ### gRPC Client To create a simple gRPC client, you can use the Spring Boot starter (see above - it's the same as for the server). Then you can inject a bean of type `GrpcChannelFactory` and use it to create a gRPC channel. The most common usage of a channel is to create a client that binds to a service, such as the one above. The Protobuf-generated sources in your project will contain the stub classes, and they just need to be bound to a channel. For example, to bind to the `SimpleGrpc` service on a local server: diff --git a/pom.xml b/pom.xml index 4a7436f..e81f4a0 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,6 @@ 3.5.0 3.3.0 0.8.10 - 1.5.0 3.1.1 2.2.3 3.7.0 @@ -183,39 +182,6 @@ - - org.codehaus.mojo - flatten-maven-plugin - ${flatten-maven-plugin.version} - - - flatten - process-resources - - flatten - - - true - ossrh - - remove - remove - remove - keep - keep - resolve - - - - - clean - clean - - clean - - - - org.apache.maven.plugins maven-deploy-plugin diff --git a/samples/grpc-server/pom.xml b/samples/grpc-server/pom.xml index 1a9edf9..539b293 100644 --- a/samples/grpc-server/pom.xml +++ b/samples/grpc-server/pom.xml @@ -42,6 +42,13 @@ pom import + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + pom + import + @@ -140,4 +147,42 @@ + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + false + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + false + + + + + \ No newline at end of file diff --git a/spring-grpc-bom/pom.xml b/spring-grpc-bom/pom.xml index 630b733..def30d1 100644 --- a/spring-grpc-bom/pom.xml +++ b/spring-grpc-bom/pom.xml @@ -49,42 +49,4 @@ - - - - org.codehaus.mojo - flatten-maven-plugin - ${flatten-maven-plugin.version} - - - flatten - process-resources - - flatten - - - true - ossrh - - remove - keep - remove - keep - keep - resolve - - - - - clean - clean - - clean - - - - - - - \ No newline at end of file