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