Maven Repositories Configuration Guide

There are two ways to configure a repository in Maven.

  1. configuration file named settings.xml
  2. storage place
<repositories>
  <repository>
    <id>central</id>
    <url>https://repo.maven.apache.org/maven2</url>
  </repository>
</repositories>
  1. a project object model file
  2. repositories
  3. storage place
<repositories>
  <repository>
    <id>my-repo</id>
    <url>https://myrepo.example.com/maven2</url>
  </repository>
</repositories>

You can configure Maven to download dependencies from which repositories using these two methods. In general, it is recommended to configure project-specific repository information in the project’s pom.xml file, while configuring global common repository information in the global configuration file.

bannerAds