修改Maven配置项

0. 打开 Maven安装目录>conf>settings.xml

1. 修改本地仓库地址(默认是 Default: ${user.home}/.m2/repository 也就是用户目录下的/.m2/repository下)

修改为自己的本地仓库地址 <localRepository>xxx</localRepository>

2. 了解 servers

当你将仓库发布到远程仓库时,在这里设置serverid,用户名,用户地址

    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>

3. 修改mirrors 镜像管理

中央仓库下载速度过慢,可以直接从镜像下载

  <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>
     -->
  </mirrors>
posted @ 2024-03-17 12:08  DawnTraveler  阅读(180)  评论(0编辑  收藏  举报