Using mirrorOf instead of changing repository URLs

To point to a repository manager, you might need to change each and every repository defined in your application POM file or the settings.xml file. Instead of changing the repository itself, it is recommended to use a mirror.

For example, you might already have a repository under the central ID, as shown in the following code:

<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>central</id>
  <name>Central Repository</name>
  <url>http://repo.maven.apache.org/maven2</url>
</repository>

Instead of changing the url tag of the preceeding configuration, you can define a mirror as shown in the following code. As the value of the mirrorOf element is set to *, any of the repositories defined ...

Get Mastering Apache Maven 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.