49

I need to use the Confluent kafka-avro-serializer Maven artifact. From the official guide I should add this repository to my Maven pom

<repository>
  <id>confluent</id>
  <url>http://packages.confluent.io/maven/</url>
</repository>

The problem is that the URL http://packages.confluent.io/maven/ seems to not work at the moment as I get the response below

<Error>
  <Code>NoSuchKey</Code>
  <Message>The specified key does not exist.</Message>
  <Key>maven/</Key>
  <RequestId>15E287D11E5D4DFA</RequestId>
  <HostId>
    QVr9lCF0y3SrQoa1Z0jDWtmxD3eJz1gAEdivauojVJ+Bexb2gB6JsMpnXc+JjF95i082hgSLJSM=
  </HostId>
</Error>

In fact Maven does not find the artifact

<dependency>
  <groupId>io.confluent</groupId>
  <artifactId>kafka-avro-serializer</artifactId>
  <version>3.1.1</version>
</dependency>

Do you know what the problem could be? Thank you

1
  • The URL needs to be in https instead of the http
    – Arefe
    Sep 15, 2022 at 8:30

8 Answers 8

42

Needs to add confluent repositories in pom.xml
Please add below lines in the pom.xml

<repositories>
    <repository>
        <id>confluent</id>
        <url>https://packages.confluent.io/maven/</url>
    </repository>
</repositories>
3
  • 1
    this helped my url was <url>packages.confluent.io/</url>
    – ronit
    May 26, 2021 at 6:21
  • It worked for me! Thanks!
    – Onur Tokat
    Jan 4, 2022 at 22:01
  • 1
    Worked for me with a slight change of http to https.
    – Lily
    Apr 27, 2022 at 20:16
26

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/

6
  • Thanks @Kevin. I'm using a central Artifactory mirror so I should add the Confluent repository to the mirrored ones in Artifactory. But when I try to add it, I get an error Input may not be null. How can I let Artifactory resolve the Confluent artifacts if the repository is not browsable?
    – gvdm
    Apr 19, 2017 at 7:58
  • With not browsable i mean through a browser by us, which makes us guess about the contents instead of being able to verify it visually. When adding to Artifactory: You should enter "maven" as repository key and "http:// packages.confluent.io/" as url (ignore the space, otherwise it didnt show the http)
    – Kevin
    Apr 19, 2017 at 8:17
  • I tried adding only http://packages.confluent.io/ and the error does not appear, but no artifact is fetched from it.
    – gvdm
    Apr 19, 2017 at 8:34
  • 1
    I think the artifacts are only fetched when you call for them, so you should now be able to add your artifactory as a repository (instead of the coonfluent one) and your dependency should be loaded through your artifactory (and will then be visible there)
    – Kevin
    Apr 19, 2017 at 8:46
  • 2
    Note that this repo is availaible in https as well just as https://repo.maven.apache.org/maven2/
    – bric3
    Jan 30, 2018 at 10:45
19

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.

1
  • Just a additional help that the mirror should be adjusted in conf/settings.xml of m2. And the confluent dependency should be adjusted in the module where it is listed. My additional requirement was to point it to local .m2 so confluent url I put as: file:///c/Users/<login>/.m2/repository/. Hope it will help someone searching to point to a local folder. Dec 13, 2018 at 17:45
13

seams jar file removed from http url or http url not working. https url worked for me.

<repositories>
<repository>
    <id>confluent</id>
    <url>https://packages.confluent.io/maven/</url>
</repository>
7

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>
1
  • 3
    just the mirror worked fine for me, so have an up-vote. Thank you Apr 2, 2019 at 10:58
4

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.

3
  • Hi @rndgstn, my problem is that the Kafka repository is not "proxable" by the company's Artifactory repository, so in our company we cannot use the Artifacotry to access also the Kafka repo. At the moment we manually download the artifacts and upload them to the company repo. This is not the ideal solution, so I hope that in the future it will be proxable
    – gvdm
    Sep 25, 2017 at 8:28
  • It is working fine for us. What error are you seeing when a client makes a request?
    – rndgstn
    Sep 25, 2017 at 11:32
  • FWIW, the http scheme worked for me as a proxied repo with Sonatype Nexus. https scheme did not work.
    – user944849
    Jun 11, 2018 at 21:28
2

Adding confluent repository worked in POM file for Maven project.

Use below in build.sbt for SBT projects

resolvers += "confluent" at "https://packages.confluent.io/maven/"
2

Had issue with:

<repositories>
        <repository>
            <id>confluent</id>
            <url>http://packages.confluent.io/maven/</url>
        </repository>
</repositories>

working:

<repositories>
        <repository>
            <id>confluent</id>
            <url>https://packages.confluent.io/maven/</url>
        </repository>
</repositories>

Changed "http" with "https" worked for me as maven has blocked the HTTP due to security reasons.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.