macos M1编译Flink 源码问题
一、flink编译flink-runtime-web出现Failed to execute goal com.github.eirslett:frontend-maven-plugin
Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) on project tdpco-web-app-ui: Could not download Node.js: Got error code 404 from the server. -> [Help 1] 原因:macos M1不兼容导致
解决方案: 修改com.github.eirslett插件版本为1.11.0以上 https://github.com/eirslett/frontend-maven-plugin/issues/857
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.0</version>
二、 The following artifacts could not be resolved: oro:oro:jar:2.0.8-osgi, xml-resolver:xml-resolver:jar:1.2-osgi: Could not find artifact oro:oro:jar:2.0.8-osgi
原因:检查本地maven仓库没有对应版本jar包,项目中也没有配置对应pom依赖
**解决方案:**在pom文件中临时添加对应pom依赖,下载完成后在进行编译
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2-osgi</version>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8-osgi</version>
</dependency>
三、Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.5.1 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
原因:无法下载对应jar包,单独下载也失败 Could not find artifact com.google.protobuf:protoc:jar:3.5.1 in alimaven (https://maven.aliyun.com/repository/central) protobuf目前没有开发m1 芯片的包,替换成x86的(暂时,后面等开发升级版本即可)
解决方案: 1、下载protoc-3.18.0-osx-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/tag/v3.5.1 解压zip包
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.5.1 -Dclassifier=osx-x86_64 -Dpackaging=exe -Dfile=/Users/bihaiyang/Downloads/javaSoftware/protoc-3.5.1-osx-x86_64/bin/protoc
2、修改 ${os.detected.classifier} 为 exe:osx-x86_64
四、[ERROR] Failed to execute goal on project flink-avro-confluent-registry: Could not resolve dependencies for project org.apache.flink:flink-avro-confluent-registry:jar:1.15-SNAPSHOT: Could not find artifact io.confluent:kafka-schema-registry-client:jar:5.5.2 in terminus (http://repo.terminus.io/content/groups/public/) -> [Help 1]
解决方案: http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.5.2/kafka-schema-registry-client-5.5.2.jar http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/5.5.2/kafka-avro-serializer-5.5.2.jar 到上面这个地址进行下载,然后到文件所在目录执行命令进行安装
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=5.5.2 -Dpackaging=jar -Dfile=/Users/bihaiyang/Downloads/kafka-schema-registry-client-5.5.2.jar
依次下载: kafka-avro-serializer-5.5.2.jar
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-avro-serializer -Dversion=5.5.2 -Dpackaging=jar -Dfile=/Users/bihaiyang/Downloads/kafka-avro-serializer-5.5.2.jar
kafka-schema-serializer-5.5.2.jar
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-serializer -Dversion=5.5.2 -Dpackaging=jar -Dfile=/Users/bihaiyang/Downloads/kafka-schema-serializer-5.5.2.jar
注:其他问题参考 https://www.it610.com/article/1305099524309553152.htm
|