2

我正在使用 maven 3 运行应用程序,但出现以下错误:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for io.confluent:kafka-rest:[unknown-version]: Could not find artifact io.confluent:kafka-rest-parent:pom:5.4.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 7, column 12
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project io.confluent:kafka-rest:[unknown-version] (D:\Self\kafka-rest\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for io.confluent:kafka-rest:[unknown-version]: Could not find artifact io.confluent:kafka-rest-parent:pom:5.4.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 7, column 12 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

这里分享 pom .xml 父元素

http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

   <parent>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-rest-parent</artifactId>
        <version>5.4.0-SNAPSHOT</version>
    </parent>

    <artifactId>kafka-rest</artifactId>
    <packaging>jar</packaging>
    <name>kafka-rest</name>
    <description>
        The Kafka REST Proxy provides a RESTful interface to a Kafka cluster, making it easy to
        produce and consume messages, view the state of the cluster, and perform administrative
        actions without using the native Kafka protocol or clients.
    </description>
4

2 回答 2

2

为了从 master 分支构建任何 Confluent 项目,您必须构建其父依赖项。您不会在可下载位置找到 SNAPSHOTS

这意味着检查 Kafka 源代码,使用 Gradle 安装其当前快照,然后是 Confluent 公共库,然后是 Confluent Rest utils,然后是 Schema Registry(用于 Avro 转换器),最后构建 REST 代理。

https://github.com/confluentinc/kafka-rest/wiki/FAQ

如果您只想运行 REST 代理,请下载最新的 Confluent 平台并将其余代理配置文件配置为指向任何现有的 Kafka 代理

于 2019-06-01T06:15:17.290 回答
0

另一种解决方案是构建发布版本。

您可以通过运行找到版本

git tag --list

选择一个标签 t(例如 v5.2.2)然后运行

git checkout <t>

然后运行

man clean package
于 2020-04-24T21:08:55.290 回答