修改maven本地仓库位置

来源:互联网 发布:淘宝开店交税吗 编辑:程序博客网 时间:2024/05/17 02:16


  • 首先需要安装好,假设安装位置在:D:\****\maven\apache-maven-3.3.3

  • 修改本地仓库位置,打开配置文件:D:\****\maven\apache-maven-3.3.3\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:/m2/repository</localRepository>
    表示本地仓库的地址为:d:/m2/repository。

  • 修改Eclipse中的配置,Eclipse -> Prefrences -> Maven -> User Settings

  •  -> 

  • 下面的local repository会自动识别配置文件中的配置,自己更换。点击OK完成。

    【如果setting文件改了之后,下面local repository的位置还是默认是C盘,那就说明settings.xml文件中的local Repository的位置没有改变,改成自己想要的位置即可。】


  • 首先需要安装好,假设安装位置在:D:\****\maven\apache-maven-3.3.3

  • 修改本地仓库位置,打开配置文件:D:\****\maven\apache-maven-3.3.3\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>
      -->

    将原来配置文件中的默认值改为自己maven安装的位置:
      <localRepository>D:\****\maven\repository</localRepository>

  • 修改Eclipse中的配置,Eclipse -> Prefrences -> Maven -> User Settings -> 

    下面的local repository会自动识别配置文件中的配置,自己更换。点击OK完成。

    【如果setting文件改了之后,下面local repository的位置还是默认是C盘,那就说明settings.xml文件中的local Repository的位置没有改变,改成自己想要的位置即可。】

  • 0 0