猿问

如何从原型武夫生成斯卡拉文件而不是 Java 文件

我的目标是在我的项目中使用。通过使用演练,https://developer.lightbend.com/docs/akka-grpc/current/client/walkthrough.html 我试图生成 Scala 文件。但是,每当我(通过)构建项目时,它都会生成Java文件而不是Scala文件。有没有办法生成Scala文件?我已经尝试过将Java转换为斯卡拉,但它不起作用。下面是我的原型文件(与演练中的文件相同):akka-grpcmvn clean package


syntax = "proto3";


option java_multiple_files = true;

option java_package = "example.myapp.helloworld.grpc";

option java_outer_classname = "HelloWorldProto";


package helloworld;


// The greeting service definition.

service GreeterService {

    // Sends a greeting

    rpc SayHello (HelloRequest) returns (HelloReply) {}


    rpc ItKeepsTalking (stream HelloRequest) returns (HelloReply) {}


    rpc ItKeepsReplying (HelloRequest) returns (stream HelloReply) {}


    rpc StreamHellos (stream HelloRequest) returns (stream 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;

}


湖上湖
浏览 93回答 1
1回答

白衣染霜花

您应该在 maven 配置中指定这一点。从文档中:<plugin>&nbsp; &nbsp; <groupId>com.lightbend.akka.grpc</groupId>&nbsp; &nbsp; <artifactId>akka-grpc-maven-plugin</artifactId>&nbsp; &nbsp; <version>${akka.grpc.version}</version>&nbsp; &nbsp; <configuration>&nbsp; &nbsp; &nbsp; <language>Scala</language>&nbsp; &nbsp; &nbsp; <generateClient>false</generateClient>&nbsp; &nbsp; &nbsp; <generateServer>true</generateServer>&nbsp; &nbsp; </configuration></plugin>
随时随地看视频慕课网APP

相关分类

Java
我要回答