maven 如何修改倉庫repository 位置

1 測試maven 是否已經安裝成功java

mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:3

7-04:00)

Maven home: C:\apache-maven-3.3.3\bin\..

Java version: 1.7.0_75, vendor: Oracle Corporation

Java home: C:\Java\jdk1.7.0_75\jre

Default locale: en_US, platform encoding: Cp1252

OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

若是現實上述信息證實安裝成功。apache

 

2 找出當前maven settings.xml 和 倉庫的位置 windows

若是你有多個settings.xml 可是不清楚當前maven 是讀取哪一個 能夠執行以下指令maven

默認倉庫位置 $uer.home/.m2ide

 

mvn -X

        ...
        ...
 [DEBUG] Reading global settings from C:\apache-maven-3.3.3\bin\..\conf\settings.

xml

[DEBUG] Reading user settings from C:\Users\jian_j\.m2\settings.xml

[DEBUG] Reading global toolchains from C:\apache-maven-3.3.3\bin\..\conf\toolcha

ins.xml

[DEBUG] Reading user toolchains from C:\Users\jian_j\.m2\toolchains.xml

[DEBUG] Using local repository at C:\maven_repo

[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\m

aven_repo

 經過上述信息能夠查看出是讀取哪一個settings.xml 而且知道當前倉庫local repo 的位置測試

 

3 設置自定義倉庫位置orm

找到settings.xml 修改localRepositoryxml

<
settings
>

  
<!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ~/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->


<
localRepository
>
才:/maven_repo
</
localRepository
>
相關文章
相關標籤/搜索