Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Mirrored repositories


Most of the Maven repositories maintain a set of mirrored repositories to cater to high demand. Maven repositories are defined in the application pom.xml file in a project specific manner. Mirrored repositories are defined outside the application POM, either in MAVEN_HOME/conf/settings.xml or USER_HOME/.m2/settings.xml. A given repository can have multiple mirrored repositories in multiple geographical locations, for example, one in the US, one in Europe, and another in Asia. Based on the user's proximity, they can pick the mirrored repository. Due to the same reason, we cannot define it in the application POM file. In a large-scale project, developers can come from every corner of the world, and we cannot define a mirrored repository in the application POM. Each developer can define the most appropriate mirrored repository for him/her in USER_HOME/.m2/settings.xml under the <mirrors> configuration element, as follows:

<mirror>
  <id>mirrorId</id...