在eclipse中安装好maven2的插件后:

第一步:

默认会放在~/.m2/repository目录下 (“~”代表用户的目录,比如windows7下一般都是C:\Users\zz\.m2\repository),

但是一般不想放在C盘下,所以换个仓库位置(E:/mavenrepository)。

修改maven仓库位置

第二步:

修改配置文件,将下载的maven2中conf文件夹下的settings.xml复制到C:\Users\zz\.m2\repository(或者E:/mavenrepository)中,并将其中的

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

修改为:

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

<localRepository>E:/mavenrepository</localRepository>

 注:这一行一定要放在外面

第三步:

修改Eclipse的MAVEN的存储位置:

点击Browser按钮,选择settings.xml文件,点击update Settings按钮即可。

相关文章:

  • 2021-05-26
  • 2021-05-28
  • 2021-07-12
  • 2022-01-05
  • 2021-08-05
  • 2022-01-11
猜你喜欢
  • 2021-09-24
  • 2021-06-18
  • 2022-12-23
  • 2021-06-13
  • 2021-06-18
  • 2021-11-22
  • 2021-07-28
相关资源
相似解决方案