嘿,我想在 intellij idea 插件中设置 protobuf 作为其他 protobuf 服务器(用 golang 编写)的客户端。这将是我使用 grpc 的第一个 java 方法。我尝试使用 kotlin 类生成器,但我的成功程度甚至不如这种方法。
我的目标是: 最好的情况:插件将允许将 proto 编译为 kt 文件 非常好的情况:插件将 java 文件输出到 src/main/proto
现有代码结构:
└───src
├───main
│ ├───kotlin
│ │ └───pl
│ │ └───dominikw
│ │ ├───configuration
│ │ ├───model
│ │ ├───service
│ │ │ └───impl
│ │ └───ui
│ ├───proto
│ └───resources
│ ├───icons
│ └───META-INF
└───test
├───kotlin
└───resources
并且错误代码如下:
7:17:20 PM: Executing task 'generateProto'...
> Task :extractIncludeProto UP-TO-DATE
> Task :extractProto UP-TO-DATE
> Task :generateProto FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateProto'.
> protoc: stdout: . stderr: C:\Users\XXX\IdeaProjects\Windchill-Intellij-Plugin\build\extracted-protos\main\service.proto: Input is shadowed in the --proto_path by "C:/Users/XXX/IdeaProjects/Windchill-Intellij-Plugin/src/main/proto/service.proto". Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
3 actionable tasks: 1 executed, 2 up-to-date
7:17:20 PM: Task execution finished 'generateProto'.
慕少森
相关分类