修改Maven配置項

DawnTraveler發表於2024-03-17

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>

相關文章