Maven修改本地仓库路径

仓库知识参考 http://www.cnblogs.com/luotaoyeah/p/3785044.html

1. 修改配置文件settings.xml

  假设你的maven位置在 D:apache-maven-3.3.9 ,打开配置文件 D:apache-maven-3.3.9confsettings.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:
epository</localRepository>

  其中,D: epository 即为本地仓库位置,当然你可以改为其他位置。

2. 修改Eclipse中的配置

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

  

  修改User Settings中的路径为你的settins.xml的位置,如D:apache-maven-3.3.9confsettings.xml 。如果此时发现下面的Local Repository并非你在settings.xml中设置的,请检查下settings.xml是否搞对了。

  点一下Update Settings和Reindex,确定就可以了。

原文地址:https://www.cnblogs.com/leonbond/p/5465723.html