[SOLVED] Maven Could not find artifact io.confluent:kafka-avro-serializer:jar:3.3.1 in central (https://repo.maven.apache.org/maven2) – trvial reason and easy solution in 1 min!

You are currently viewing [SOLVED] Maven Could not find artifact io.confluent:kafka-avro-serializer:jar:3.3.1 in central (https://repo.maven.apache.org/maven2) – trvial reason and easy solution in 1 min!
Photo by Árpád Czapp on Unsplash
Share This Post, Help Others, And Earn My Heartfelt Appreciation! :)
4.9
(2114)

Cause of Maven Could Not Find Artifact

This is typical error [ Maven could not find artifact ] when you first time use dependencies which are not coming from the most popular maven repository. In this case I wanted to use package which is coming from Confluent Maven repository.

Solution

You need to add missing repository. You can do it in two ways. You need to choose which one is better for you. In first option the repository will be only visible in this particular project. If you will go with second option the new repository will be visible for all your projects – it means that if you will create in the future the another project which requires packages from this repository, it will be able to pull dependencies.

  • adding directly to your project pom.xml file.
  • adding to settings.xml file

Option #1

Please include this snip of xml code in your pom.xml file:

<repositories>
	<repository>
		<id>confluent</id>
		<url>http://packages.confluent.io/maven/</url>
		<releases>
			<enabled>true</enabled>
		</releases>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
	</repository>
</repositories>

Option #2

Put above xml code in existing profile in setting.xml or create the new one, but:

Remember: if you will create new profile you must remember to add this profile in section <activeProfiles>

If you enjoyed this post please add the comment below and share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!

How useful was this post?

Click on a star to rate it!

Average rating 4.9 / 5. Vote count: 2114

No votes so far! Be the first to rate this post.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments