1 回答
TA贡献1853条经验 获得超6个赞
首先,按照文档使用组织
或者,您可以复制示例 pom.xml(这固定到 v1.19.0 版本,请考虑使用最新的标记)。这个pom被问候世界的例子使用,等等。
然后添加原型专家插件的 和 目标。这将导致 生成 中的文件。test-compile
test-compile-custom
src/test/proto
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
<goal>test-compile</goal>
<goal>test-compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
添加回答
举报