Confluent Maven repository not working?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 11:13:54

The file is available, since you can download it if you go to it directly: http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/3.1.1/kafka-avro-serializer-3.1.1.jar

You could try adding the -U flag to your maven command to force download of cached files.

The root of the repo isn't browsable which is why you are getting the message when browsing to http://packages.confluent.io/maven/

Just like you I use a company repository (Sonatype Nexus) and was not able to proxy the confluent's repository.

Then I changed my maven settings.xml to exclude confluent form the mirrored repository:

    <mirrors>
        <mirror>
            <id>nexus</id>
            <mirrorOf>*,!confluent</mirrorOf> <!-- mirror anything but confluent as Nexus cannot proxy it -->
            <url>repository.company.local/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
    ...
        <repositories>
            ...
            <repository>
                <id>confluent</id>
                <url>http://packages.confluent.io/maven/</url>
            </repository>
        </repositories>

This way, artifacts resolution works for confluents' artifacts as well.

Not as neat as proxying the repo but at least less cumbersome than downloading and registering each dependency manually.

When trying to connect Artifactory to the Confluent Maven repository you have to set the repo URL in Artifactory to be either http://packages.confluent.io/maven or https://packages.confluent.io/maven (both schemes seem to work fine). The confusing part is that when you ask Artifactory to test that URL it will fail with the message "Input may not be null". You are also unable to browse the repository in Artifactory. However, regardless of these problems, artifacts will be downloaded and cached when clients request them.

You can add a mirror in you maven settings file to fetch the jars from confluent repo along with repository config . Changes needed are Add a mirror in settings.xml

   <mirror>
      <id>confluent</id>
      <mirrorOf>confluent</mirrorOf>
      <name>Nexus public mirror</name>
      <url>http://packages.confluent.io/maven/</url>
</mirror>

In repository section of maven settings add this

<repository>
          <id>confluent</id>
          <url>http://packages.confluent.io/maven/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
</repository>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!