Maven修改本地倉庫路徑


倉庫知識參考 http://www.cnblogs.com/luotaoyeah/p/3785044.html

 

1. 修改配置文件settings.xml

  假設你的maven位置在 D:\apache-maven-3.3.9 ,打開配置文件 D:\apache-maven-3.3.9\conf\settings.xml ,找到這行:

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

  追加一行:

<localRepository>D:\repository</localRepository>

  其中,D:\repository 即為本地倉庫位置,當然你可以改為其他位置。

2. 修改Eclipse中的配置

  打開 Eclipse -> Prefrences -> Maven -> User Settings -> 

  

  修改User Settings中的路徑為你的settins.xml的位置,如D:\apache-maven-3.3.9\conf\settings.xml 。如果此時發現下面的Local Repository並非你在settings.xml中設置的,請檢查下settings.xml是否搞對了。

  點一下Update Settings和Reindex,確定就可以了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM