How to Add Maven Central Repository in pom.xml


If you make use of the Maven build tool for your Java project, you can set the Maven Central Repository in your pom.xml file by simply adding the repository tag with URL https://repo.maven.apache.org/maven2/


Example:
<project>
  ...
  ...

  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2/</url>
    </repository>
  </repositories>

  ...
  ...
</project>

Adding maven central repo to pom.xml file
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap