首页 > 解决方案 > 无法创建 KSQL UDF jar

问题描述

我为 KSQL 实现了一个 UDF(用户定义函数)并根据https://docs.confluent.io/current/ksql/docs/developer-guide/udf.html配置了 Maven pom.xml 文件

当我尝试使用创建 jar 文件时mvn clean package遇到以下错误:

[ERROR] Failed to execute goal on project CustomUDF: Could not resolve dependencies for project XXXX:CustomUDF:jar:1.0-SNAPSHOT: Failure to find kafka-avro-confluent:kafka-avro-confluent:jar:0.1.0 in http://packages.confluent.io/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of confluent has elapsed or updates are forced -> [Help 1]

我在模式注册表 GitHub 常见问题解答中发现了一个相关问题: https ://github.com/confluentinc/schema-registry/wiki/FAQ#when-i-try-to-compile-i-get-an-error-about-缺少快照依赖项

这是解决我的错误的正确方法吗?我尝试按照说明构建依赖项,但./gradlew installAll只会导致更多错误(如果这是修复错误的正确方法,我可以分享)。

“或者,使用发布标签(例如 v3.2.0)作为新开发分支的基础”是什么意思?详细的意思?这会是一个合适的选择吗?

标签: apache-kafkaconfluent-platformksqldb

解决方案


更新:我能够通过直接使用 IntelliJ 而不是 shell 命令创建 jar 文件来创建它:

我打开 Maven 窗口并选择My Project name -> Lifecycle -> install -> Run Maven Build在我的 IntelliJ 项目文件夹的目标子文件夹中创建 jar。

之后我按照正常的 KSQL UDF 部署步骤(https://docs.confluent.io/current/ksql/docs/developer-guide/udf.html#deploying),一切正常。


推荐阅读