2121 <HikariCP .version>4.0.3</HikariCP .version>
2222 <commons-lang .version>3.12.0</commons-lang .version>
2323 <guava .version>31.0.1-jre</guava .version>
24+ <protoc .version>3.19.1</protoc .version>
25+ <grpc .version>1.43.0</grpc .version>
2426 <tapdata .pdk.api.version>1.4.1-SNAPSHOT</tapdata .pdk.api.version>
2527 </properties >
2628
115117 <artifactId >tapdata-pdk-runner</artifactId >
116118 <scope >test</scope >
117119 </dependency >
120+ <!-- grpc相关依赖 begin -->
121+ <dependency >
122+ <groupId >com.google.protobuf</groupId >
123+ <artifactId >protobuf-java-util</artifactId >
124+ <version >${protoc.version} </version >
125+ <exclusions >
126+ <exclusion >
127+ <artifactId >guava</artifactId >
128+ <groupId >com.google.guava</groupId >
129+ </exclusion >
130+ <exclusion >
131+ <artifactId >error_prone_annotations</artifactId >
132+ <groupId >com.google.errorprone</groupId >
133+ </exclusion >
134+ <exclusion >
135+ <groupId >org.slf4j</groupId >
136+ <artifactId >slf4j-api</artifactId >
137+ </exclusion >
138+ </exclusions >
139+ </dependency >
140+ <dependency >
141+ <groupId >io.grpc</groupId >
142+ <artifactId >grpc-protobuf</artifactId >
143+ <version >${grpc.version} </version >
144+ </dependency >
145+ <dependency >
146+ <groupId >io.grpc</groupId >
147+ <artifactId >grpc-stub</artifactId >
148+ <version >${grpc.version} </version >
149+ </dependency >
150+ <dependency >
151+ <groupId >io.grpc</groupId >
152+ <artifactId >grpc-netty-shaded</artifactId >
153+ <!-- <scope>runtime</scope>-->
154+ <version >${grpc.version} </version >
155+ </dependency >
156+ <dependency >
157+ <groupId >com.google.errorprone</groupId >
158+ <artifactId >error_prone_annotations</artifactId >
159+ <version >2.9.0</version >
160+ </dependency >
118161 </dependencies >
119162 <build >
163+ <!-- os系统信息插件, protobuf-maven-plugin需要获取系统信息下载相应的protobuf程序 -->
164+ <extensions >
165+ <extension >
166+ <groupId >kr.motd.maven</groupId >
167+ <artifactId >os-maven-plugin</artifactId >
168+ <version >1.6.2</version >
169+ </extension >
170+ </extensions >
171+
120172 <plugins >
121173 <plugin >
122174 <groupId >org.apache.maven.plugins</groupId >
223275 <target >8</target >
224276 </configuration >
225277 </plugin >
278+ <!-- grpc代码生成插件 -->
279+ <plugin >
280+ <groupId >org.xolstice.maven.plugins</groupId >
281+ <artifactId >protobuf-maven-plugin</artifactId >
282+ <version >0.6.1</version >
283+ <configuration >
284+ <protocArtifact >com.google.protobuf:protoc:${protoc.version} :exe:${os.detected.classifier}
285+ </protocArtifact >
286+ <pluginId >grpc-java</pluginId >
287+ <pluginArtifact >io.grpc:protoc-gen-grpc-java:${grpc.version} :exe:${os.detected.classifier}
288+ </pluginArtifact >
289+ <!-- 默认值-->
290+ <protoSourceRoot >${project.basedir} /src/main/proto</protoSourceRoot >
291+ <outputDirectory >${project.build.directory} /generated-sources/protobuf</outputDirectory >
292+ <!-- <outputDirectory>${project.basedir}/generated-sources</outputDirectory>-->
293+ <!-- 设置是否在生成java文件之前清空outputDirectory的文件,默认值为true,设置为false时也会覆盖同名文件-->
294+ <clearOutputDirectory >false</clearOutputDirectory >
295+ <!-- 更多配置信息可以查看https://www.xolstice.org/protobuf-maven-plugin/compile-mojo.html-->
296+ </configuration >
297+ <executions >
298+ <execution >
299+ <goals >
300+ <goal >compile</goal >
301+ <goal >compile-custom</goal >
302+ </goals >
303+ </execution >
304+ </executions >
305+ </plugin >
226306 </plugins >
227307 </build >
228308</project >
0 commit comments