Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Define a `.proto` service definition file `src/main/proto/hello.proto` with the
syntax = "proto3";

option java_multiple_files = true;
option java_package = "org.springframework.grpc.sample.proto";
option java_package = "org.springframework.grpc.sample.proto"; // !IMP: change the package name to the one you mentioned in spring initilizr
option java_outer_classname = "HelloWorldProto";

// The greeting service definition.
Expand Down Expand Up @@ -58,7 +58,9 @@ or
./gradlew build
```

You’ll get two new folders in the `target` directory (or `build` for Gradle): `target/target/generated-sources/protobuf/grpc-java` and `target/target/generated-sources/protobuf/java`. You may need to instruct your IDE to mark them as source roots. In IntelliJ IDEA, you’d right click the folder, choose `Mark Directory As` -> `Generated Source Root`. Eclipse or VSCode will add them automatically for you.
You’ll get two new folders in the `target` directory: `target/target/generated-sources/protobuf/grpc-java` and `target/target/generated-sources/protobuf/java`.
(_For gradle_, refer the `build` directory: `build/generated/source/proto/main/grpc` & `build/generated/source/proto/main/java`)
You may need to instruct your IDE to mark them as source roots. In IntelliJ IDEA, you’d right-click the folder, choose `Mark Directory As` -> `Generated Source Root`. Eclipse or VSCode will add them automatically for you.

Now you can implement a service based on the generated stubs:

Expand Down Expand Up @@ -112,7 +114,7 @@ Run the program in the usual way:
or

```shell
./gradle bootRun
./gradlew bootRun
```

You can try it out using a gRPC client like `grpcurl`:
Expand Down