修改maven调用的远程仓库

来源:互联网 发布:最新网络广告法 编辑:程序博客网 时间:2024/05/16 23:32

maven默认依赖的远程仓库位于国外服务器,可修改为国内镜像服务位置,以加快速度效率。

更多内容详见开源中国maven镜像站中帮助http://maven.oschina.net/help.html


在 Maven 中使用 OSChina 的 Maven 服务还需要简单配置一下 Maven,在 Maven 的安装目录下的 conf 文件下有个  settings.xml  文件,接下来我们需要对这个文件做简单的修改,修改前您可以简单备份下该文件。打开  settings.xml  文件,按下面内容修改


01<mirrors>
02    <!-- mirror | Specifies a repository mirror site to use instead of a given
03        repository. The repository that | this mirror serves has an ID that matches
04        the mirrorOf element of this mirror. IDs are used | for inheritance and direct
05        lookup purposes, and must be unique across the set of mirrors. | -->
06    <mirror>
07        <id>nexus-osc</id>
08        <mirrorOf>*</mirrorOf>
09        <name>Nexus osc</name>
10        <url>http://maven.oschina.net/content/groups/public/</url>
11    </mirror>
12</mirrors>
0 0
原创粉丝点击