Nano itself doesn't support services, and that's what gRPC does. You just need to pass ignore_services=true to javanano and protoc-gen-grpc-java will generate the services.
So you will need this for nano: <pluginParameter>ignore_services=true</pluginParameter> And this for grpc (if using earlier that v0.14.0, then it needs to be nano=true): <pluginParameter>nano</pluginParameter> On Mon, Jun 27, 2016 at 7:59 AM, 王 梓佳 <[email protected]> wrote: > Dear all, > > I tried to use goal protobuf:compile-javanano to generate the code(message > and rpc service stub), but i encountered a error "Java NANO_RUNTIME does > not support services". > Does the protobuf-maven-plugin has not support on it? also it seem it also > doesn't support objective-c code generation, right? Many thanks! > > *pom.xml* > <plugin> > <groupId>org.xolstice.maven.plugins</groupId> > <artifactId>protobuf-maven-plugin</artifactId> > <version>0.5.0</version> > <configuration> > <checkStaleness>true</checkStaleness> > <writeDescriptorSet>true</writeDescriptorSet> > <descriptorSetFileName>protos. > desc</descriptorSetFileName> > <protocArtifact>com.google. > protobuf:protoc:3.0.0-beta-3:exe:${os.detected.classifier}< > /protocArtifact> > <pluginId>grpc-java</pluginId> > <pluginArtifact>io.grpc:protoc-gen-grpc-java:0.14.0: > exe:${os.detected.classifier}</pluginArtifact> > </configuration> > <executions> > <execution> > <goals> > <goal>compile-javanano</goal> > <goal>compile-custom</goal> > </goals> > </execution> > </executions> > </plugin> > > *Helloworld.proto:* > syntax = "proto3"; > > option java_package = "practices.microservice.demo.protos"; > > package practices.microservice.demo.protos; > > // The greeter service definition. > service Greeter { > // Sends a greeting > rpc SayHello (HelloRequest) returns (HelloReply) {} > } > > // The request message containing the user's name. > message HelloRequest { > string name = 1; > } > > // The response message containing the greetings > message HelloReply { > string message = 1; > } > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/grpc-io/TY1PR04MB0879129698B497470A211D0CD1210%40TY1PR04MB0879. > apcprd04.prod.outlook.com > <https://groups.google.com/d/msgid/grpc-io/TY1PR04MB0879129698B497470A211D0CD1210%40TY1PR04MB0879.apcprd04.prod.outlook.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oOaR9fiMfsdKiKJG4xQSRi31mEms4tvx0yUhTYd9SszMw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
