[ERROR] Failed to execute goal com.github.os72:protoc-jar-maven-plugin:3.5.1.1:run (default) on project hive-standalone-metastore-common: Error resolving artifact: com.google.protobuf:protoc:2.5.0: Could not find artifact com.google.protobuf:protoc:exe:linux-aarch_64:2.6.1-build3 in central (https://repo.maven.apache.org/maven2)
[ERROR]
1. 安装JDK和Maven3
2. 编译Hive
直接编译会报下面的错误:
这是由于Hive依赖于
protoc-2.5.0
的库在Maven的central repo, 没有ARM64版本的,有两种方式来规避该问题,一种是修改依赖库的版本,另一种是手动编译。规避方式一:
直接编译,也会报错,需要打上补丁,脚本如下:
然后再修改Hive中的
protoc:2.5.0
的引用位置,指向本地编译好的protoc二进制文件:规避方式二:
修改Hive中
com.google.protobuf:protoc:2.5.0
的引用为com.github.os72:protoc:2.6.1-build3
该包可以在这里搜到。
重新编译Hive
再次执行
mvn -B -e clean package -Pdist -DskipTests
,编译成功:下面为Patch文件: hive-protoc-patch.tar.gz