Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confluent Maven repository not working?

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

like image 567
gvdm Avatar asked Apr 19 '17 07:04

gvdm


5 Answers

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/

like image 73
Kevin Avatar answered Nov 20 '22 14:11

Kevin


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>
like image 36
sujithramanathan Avatar answered Nov 20 '22 15:11

sujithramanathan


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.

like image 39
Ghurdyl Avatar answered Nov 20 '22 15:11

Ghurdyl


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>
like image 10
Nalin Kularathna Avatar answered Nov 20 '22 16:11

Nalin Kularathna


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>
like image 7
Pradeep S Avatar answered Nov 20 '22 16:11

Pradeep S