Maven repository address set

Modify the local address of the warehouse


maven to manage our Java third party libraries, we need to set up a local warehouse to store this address this third-party libraries.

Open the configuration file (under the Maven directory \-the Apache Maven-3.5.0 \ conf \ settings.xml) , find the <localRepository> ..</localRepository>label.

<!-- localRepository
 | The path to the local repository maven will use to store artifacts.
 |
 | Default: ${user.home}/.m2/repository
-->
<localRepository>D:/Java/maven/repo</localRepository>

Maven default local repository provided $ {user.home} / m2 / repository . Directory, here a modified D: / Java / maven / repo path.

Set up a central warehouse address


Central warehouse that is, when we have to use third-party Java libraries should where to go to download.

Also open the configuration file (\ apache-maven-3.5.0 \ conf \ settings.xml) under the Maven directory to find the ... label.

<mirrors>
  <!-- mirror
   | Specifies a repository mirror site to use instead of a given repository. The repository that
   | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
   | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
   |
  <mirror>
    <id>mirrorId</id>
    <mirrorOf>repositoryId</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://my.repository.com/repo/path</url>
  </mirror>
   -->
  <mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <!--<mirrorOf>central</mirrorOf> -->
    <mirrorOf>*</mirrorOf>
  </mirror>
</mirrors>

Here's the Maven central repository address changes to aliyun, domestic access speed will be faster.

Guess you like

Origin blog.csdn.net/weixin_44474742/article/details/90574214