Created
June 29, 2017 14:20
-
-
Save haitaoyao/d26be15fb51c21d929011e90e655422e to your computer and use it in GitHub Desktop.
maven + grpc + git submodule configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<extensions> | |
<extension> | |
<groupId>kr.motd.maven</groupId> | |
<artifactId>os-maven-plugin</artifactId> | |
<version>1.4.1.Final</version> | |
</extension> | |
</extensions> | |
<plugins> | |
<plugin> | |
<groupId>org.xolstice.maven.plugins</groupId> | |
<artifactId>protobuf-maven-plugin</artifactId> | |
<version>0.5.0</version> | |
<configuration> | |
<protocArtifact> | |
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} | |
</protocArtifact> | |
<!-- pluginId 和 pluginArtifact 只有在需要生成 gRPC 服务的时候使用, 如果不需要 gRPC 服务, 可以删除这两个元素 --> | |
<pluginId>grpc-java</pluginId> | |
<pluginArtifact> | |
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} | |
</pluginArtifact> | |
<!-- 这里是 protobuf 文件的路径 --> | |
<protoSourceRoot>${basedir}/{your_protobuf_dir}</protoSourceRoot> | |
<includes> | |
<!-- 这里写一些包含的文件相对路径 --> | |
<include>{some_files}</include> | |
</includes> | |
</configuration> | |
<executions> | |
<execution> | |
<goals> | |
<goal>compile</goal> | |
<goal>compile-custom</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment