protoc not generating service stub files

后端 未结 2 1364
[愿得一人]
[愿得一人] 2020-12-05 13:39

I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file.

proto file, https:

2条回答
  •  萌比男神i
    2020-12-05 13:50

    The command line you are showing does not enable the grpc plugin. You need to specify an _out argument for the grpc plugin, which enables the plugin and specifies where it should output files. Since the plugin is likely not in your PATH, you also need to tell protoc how to find the plugin with --plugin.

    So you need to add two arguments:

    --plugin=protoc-gen-grpc-java=path/to/protoc-gen-grpc-java --grpc-java_out=path/to/output/dir
    

    For more info, see the gRPC compiler documentation.

提交回复
热议问题