zoukankan      html  css  js  c++  java
  • maven修改远程和本地仓库地址

    简介:我们用maven的时候,maven自带的远程中央仓库经常会很慢,还有默认本地仓库是在c盘C:Users你的电脑用户账号.m2 epository,

    对于有强迫症的人,总是看的不爽,下面介绍下经验:

    我的环境:

    maven:3.3.9

    jdk:1.8_112

    intellij idea:2016.3

    windows:win10

    试验项目:spring boot 1.5.1

    首先你需要安装maven,我的maven安装的是3.3.9

    maven修改远程中央仓库地址:

    找到你的maven安装位置,找到conf下的setting.xml,我的位置D:mavenapache-maven-3.3.9confsetting.xml,打开它,

    我这里用的sublime3,默认很多都注释了,加入代码:

    <profiles>
    <profile>
    <id>dev</id>
    <!-- repositories and pluginRepositories here-->
    <repositories>
    <repository>
    <id>nexus-aliyun</id>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    </repositories>
    </profile>
    </profiles>

    <activeProfiles>
    <activeProfile>dev</activeProfile>
    </activeProfiles>

    在这里我们用的是阿里的maven远程中央仓库,试验过网速杠杠的,这个时候可以去实验下你的maven下载,看是不是阿里的远程仓库地址

    maven修改本地仓库地址:

    还是在这个setting.xml文件,搜索localRepository:

    在下面加入一行<localRepository>D:downmaven-repository epository</localRepository>,这里是我自己的maven本地仓库地址,改成自己设置的maven本地仓库地址

    然后将setting.xml(maven安装的位置D:mavenapache-maven-3.3.9confsetting.xml),复制一份到你设置的maven本地仓库地址下,

    这里的地址是D:downmaven-repository epository,配置完成了打开intellij idea,打开file->setting,搜索maven:

    将这三处修改,第一处是使用自己安装的maven,这个地方有maven2,maven3,maven3.3.9(自己安装的),选择maven3.3.9

    第二处是使用自己配置的放在本地仓库的setting.xml文件

    第三处是本地仓库的地址,点击apply,ok

    然后可以移动下自己pom.xml中的内容,右下角有下载信息,会显示从http://maven.aliyun.com/nexus/content/groups/public下载到自己定义的仓库地址

     开源中国地址:https://git.oschina.net/wustxiabin/spring-cloud.git

     github地址:    https://github.com/waterlufei/spring-cloud.git

    微信公众号:

  • 相关阅读:
    MapXtreme 2005
    QQ在线源码
    Oralce rowid
    MOSS2007 安装与部署(下)
    MapXtreme 2005新增内容
    MOSS 2007安装与部署(上)
    PL/SQL中的where子句比较
    Oracle中插入日期型数据
    在HTML语言网页中加载视频的代码
    HTTP 错误 500.24 Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.NET 设置。
  • 原文地址:https://www.cnblogs.com/waterlufei/p/6498526.html
Copyright © 2011-2022 走看看